Refs #11288: Made resource-registry more RESTful
Task-Url: https://support.d4science.org/issues/11288 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@169046 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
1207bb6570
commit
7caa7b9766
|
@ -4,16 +4,12 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import javax.ws.rs.Consumes;
|
||||
import javax.ws.rs.DELETE;
|
||||
import javax.ws.rs.PUT;
|
||||
import javax.ws.rs.Path;
|
||||
import javax.ws.rs.PathParam;
|
||||
import javax.ws.rs.Produces;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
|
||||
import org.gcube.informationsystem.model.entity.Context;
|
||||
import org.gcube.informationsystem.resourceregistry.ResourceInitializer;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.context.ContextNotFoundException;
|
||||
import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.resource.ResourceNotFoundException;
|
||||
|
@ -49,10 +45,8 @@ public class SharingManagement {
|
|||
*
|
||||
*/
|
||||
@PUT
|
||||
@Path("/" + SharingPath.CONTEXTS_PATH_PART + "/{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}" + "/"
|
||||
+ AccessPath.TYPE_PATH_PARAM + "/{" + AccessPath.UUID_PATH_PARAM + "}")
|
||||
@Consumes({MediaType.TEXT_PLAIN, ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8})
|
||||
@Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8)
|
||||
@Path(SharingPath.CONTEXTS_PATH_PART + "/{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}" + "/{"
|
||||
+ AccessPath.TYPE_PATH_PARAM + "}" + "/{" + AccessPath.UUID_PATH_PARAM + "}")
|
||||
public boolean add(@PathParam(AccessPath.CONTEXT_UUID_PATH_PARAM) String contextId,
|
||||
@PathParam(AccessPath.TYPE_PATH_PARAM) String type, @PathParam(AccessPath.UUID_PATH_PARAM) String id)
|
||||
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException {
|
||||
|
@ -89,10 +83,8 @@ public class SharingManagement {
|
|||
*
|
||||
*/
|
||||
@DELETE
|
||||
@Path("/" + SharingPath.CONTEXTS_PATH_PART + "/{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}" + "/"
|
||||
+ AccessPath.TYPE_PATH_PARAM + "/{" + AccessPath.UUID_PATH_PARAM + "}")
|
||||
@Consumes({MediaType.TEXT_PLAIN, ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8})
|
||||
@Produces(ResourceInitializer.APPLICATION_JSON_CHARSET_UTF_8)
|
||||
@Path(SharingPath.CONTEXTS_PATH_PART + "/{" + AccessPath.CONTEXT_UUID_PATH_PARAM + "}" + "/{"
|
||||
+ AccessPath.TYPE_PATH_PARAM + "}" + "/{" + AccessPath.UUID_PATH_PARAM + "}")
|
||||
public boolean remove(@PathParam(AccessPath.CONTEXT_UUID_PATH_PARAM) String contextId,
|
||||
@PathParam(AccessPath.TYPE_PATH_PARAM) String type, @PathParam(AccessPath.UUID_PATH_PARAM) String id)
|
||||
throws ResourceNotFoundException, ContextNotFoundException, ResourceRegistryException {
|
||||
|
|
Loading…
Reference in New Issue