Rename package exceptions to codeexceptions.

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/resource-management/resource-manager@162028 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Manuele Simi 2018-01-10 04:12:00 +00:00
parent aedbeed7de
commit 4e6d0a1192
16 changed files with 29 additions and 28 deletions

View File

@ -1,4 +1,4 @@
package org.gcube.resourcemanagement.manager.io.exceptions;
package org.gcube.resourcemanagement.manager.io.codeexceptions;
import javax.ws.rs.core.GenericEntity;

View File

@ -1,4 +1,4 @@
package org.gcube.resourcemanagement.manager.io.exceptions;
package org.gcube.resourcemanagement.manager.io.codeexceptions;
import java.util.stream.Stream;

View File

@ -1,4 +1,4 @@
package org.gcube.resourcemanagement.manager.io.exceptions;
package org.gcube.resourcemanagement.manager.io.codeexceptions;
/**
* Interface for error codes.

View File

@ -1,5 +1,5 @@
package org.gcube.resourcemanagement.manager.io.exceptions;
package org.gcube.resourcemanagement.manager.io.codeexceptions;
/**
* A local exception wrapping an {@link ErrorCode}.

View File

@ -1,4 +1,4 @@
package org.gcube.resourcemanagement.manager.io.exceptions;
package org.gcube.resourcemanagement.manager.io.codeexceptions;
/**
* An {@link ErrorCode} that can be serialized in a {@link WebCodeException}.

View File

@ -1,4 +1,4 @@
package org.gcube.resourcemanagement.manager.io.exceptions;
package org.gcube.resourcemanagement.manager.io.codeexceptions;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;

View File

@ -0,0 +1,8 @@
/**
* Code Exception is capable to hold an error code
* and an associated message, wrap them into a REST response and return them to the caller.
*
* @author Manuele Simi (ISTI - CNR)
*
*/
package org.gcube.resourcemanagement.manager.io.codeexceptions;

View File

@ -1,6 +0,0 @@
/**
* Exception handling in the Resource Management.
* @author Manuele Simi (ISTI - CNR)
*
*/
package org.gcube.resourcemanagement.manager.io.exceptions;

View File

@ -1,6 +1,6 @@
package org.gcube.resourcemanagement.manager.io.rs;
import org.gcube.resourcemanagement.manager.io.exceptions.ErrorCode;
import org.gcube.resourcemanagement.manager.io.codeexceptions.ErrorCode;
/**
* Error codes returned by the context resource.

View File

@ -1,10 +1,11 @@
/**
*
*/
package org.gcube.resourcemanagement.manager.io.exceptions;
package org.gcube.resourcemanagement.manager.io.codeexceptions;
import static org.junit.Assert.*;
import org.gcube.resourcemanagement.manager.io.codeexceptions.LocalCodeException;
import org.gcube.resourcemanagement.manager.io.rs.RMCode;
import org.junit.Test;
@ -17,7 +18,7 @@ import org.junit.Test;
public class LocalCodeExceptionTest {
/**
* Test method for {@link org.gcube.resourcemanagement.manager.io.exceptions.LocalCodeException#CodeException(org.gcube.resourcemanagement.manager.io.exceptions.ErrorCode)}.
* Test method for {@link org.gcube.resourcemanagement.manager.io.codeexceptions.LocalCodeException#CodeException(org.gcube.resourcemanagement.manager.io.codeexceptions.ErrorCode)}.
*/
@Test
public void testCodeException() {

View File

@ -1,10 +1,10 @@
package org.gcube.resourcemanagement.manager.io.exceptions;
package org.gcube.resourcemanagement.manager.io.codeexceptions;
import static org.junit.Assert.*;
import java.util.Objects;
import org.gcube.resourcemanagement.manager.io.exceptions.WebCodeException;
import org.gcube.resourcemanagement.manager.io.codeexceptions.WebCodeException;
import org.gcube.resourcemanagement.manager.io.rs.RMCode;
import org.junit.Test;
import org.junit.runner.RunWith;
@ -21,7 +21,7 @@ public class WebCodeExceptionTest {
/**
* Test method for
* {@link org.gcube.resourcemanagement.manager.io.exceptions.WebCodeException#CodeException(org.gcube.resourcemanagement.manager.io.rs.RMCode)}.
* {@link org.gcube.resourcemanagement.manager.io.codeexceptions.WebCodeException#CodeException(org.gcube.resourcemanagement.manager.io.rs.RMCode)}.
*/
@Test
public void testWebCodeException() {

View File

@ -5,7 +5,7 @@ import java.util.Objects;
import org.gcube.informationsystem.model.entity.Context;
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextAlreadyPresentException;
import org.gcube.resourcemanagement.manager.io.exceptions.WebCodeException;
import org.gcube.resourcemanagement.manager.io.codeexceptions.WebCodeException;
import org.gcube.resourcemanagement.manager.io.rs.RMCode;
/**

View File

@ -5,7 +5,7 @@ import java.util.Objects;
import org.gcube.informationsystem.resourceregistry.context.ResourceRegistryContextClient;
import org.gcube.informationsystem.resourceregistry.context.ResourceRegistryContextClientFactory;
import org.gcube.informationsystem.resourceregistry.context.ResourceRegistryContextClientImpl;
import org.gcube.resourcemanagement.manager.io.exceptions.WebCodeException;
import org.gcube.resourcemanagement.manager.io.codeexceptions.WebCodeException;
import org.gcube.resourcemanagement.manager.io.rs.RMCode;
/**
@ -40,7 +40,7 @@ public abstract class RequestToResourceRegistry {
this.validate();
} catch (Exception e) {
ResponseFromResourceRegistry response = ResponseFromResourceRegistry.
fromException(new WebCodeException(RMCode.INVALID_REQUEST));
fromException(new WebCodeException(RMCode.INVALID_REQUEST_FOR_RR));
return response;
}
if (Objects.isNull(this.resourceRegistryContextClient))

View File

@ -2,7 +2,7 @@ package org.gcube.resourcemanagement.manager.webapp.context;
import java.util.Optional;
import org.gcube.resourcemanagement.manager.io.exceptions.WebCodeException;
import org.gcube.resourcemanagement.manager.io.codeexceptions.WebCodeException;
/**
* The response to a {@link RequestToResourceRegistry}.

View File

@ -12,8 +12,8 @@ import org.gcube.common.authorization.library.provider.CalledMethodProvider;
import org.gcube.informationsystem.model.entity.Context;
import static org.gcube.resourcemanagement.manager.io.rs.RMContextPath.*;
import org.gcube.resourcemanagement.manager.io.exceptions.LocalCodeException;
import org.gcube.resourcemanagement.manager.io.exceptions.WebCodeException;
import org.gcube.resourcemanagement.manager.io.codeexceptions.LocalCodeException;
import org.gcube.resourcemanagement.manager.io.codeexceptions.WebCodeException;
import org.gcube.resourcemanagement.manager.io.rs.RMCode;
import org.gcube.resourcemanagement.manager.webapp.ResourceInitializer;
import org.gcube.resourcemanagement.manager.webapp.context.CreateRequest;
@ -56,8 +56,6 @@ public class RMContext {
response = Response.status(Status.BAD_REQUEST)
.entity(returned.getMessage().map(m -> m).orElse("Failed to create the context.")).build();
}
LocalCodeException lce = null
throw new WebCodeException(lce);
return response;
}
@DELETE

View File

@ -18,8 +18,8 @@ import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.informationsystem.impl.entity.ContextImpl;
import org.gcube.informationsystem.impl.utils.ISMapper;
import org.gcube.informationsystem.model.entity.Context;
import org.gcube.resourcemanagement.manager.io.exceptions.CodeFinder;
import org.gcube.resourcemanagement.manager.io.exceptions.SerializableErrorCode;
import org.gcube.resourcemanagement.manager.io.codeexceptions.CodeFinder;
import org.gcube.resourcemanagement.manager.io.codeexceptions.SerializableErrorCode;
import org.gcube.resourcemanagement.manager.io.rs.RMCode;
import org.gcube.resourcemanagement.manager.io.rs.RMContextPath;
import org.gcube.resourcemanagement.manager.webapp.rs.RMContext;