Class SharingManager


  • @Path("sharing")
    public class SharingManager
    extends BaseRest
    Author:
    Luca Frosini (ISTI - CNR)
    • Constructor Detail

      • SharingManager

        public SharingManager()
    • Method Detail

      • serializeAffectedInstaces

        protected String serializeAffectedInstaces​(org.gcube.com.fasterxml.jackson.databind.ObjectMapper objectMapper,
                                                   Map<UUID,​org.gcube.com.fasterxml.jackson.databind.JsonNode> affectedInstances)
                                            throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      • addRemoveNoPropagationConstraint

        public String addRemoveNoPropagationConstraint​(@PathParam("CONTEXT_UUID")
                                                       String contextId,
                                                       @QueryParam("operation")
                                                       org.gcube.informationsystem.resourceregistry.api.rest.SharingPath.SharingOperation operation,
                                                       @QueryParam("dryRun") @DefaultValue("false")
                                                       Boolean dryRun,
                                                       @QueryParam("forceAddToContext") @DefaultValue("false")
                                                       Boolean forceAddToContext,
                                                       String body)
                                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException,
                                                       org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException,
                                                       org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                                       org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Add/Remove to/from the context identified by CONTEXT_UUID path parameter the list of instances contained in the body of the request. The the body is the following [ {"type" : "HostingNode", "id" : "16032d09-3823-444e-a1ff-a67de4f350a8" }, {"type" : "Hosts", "id" : "97ab8a6b-6b1b-4868-b8fc-ba48d0439ba9"}, {"type" : "EService", "id" : "d3b1a29b-aa70-4a5a-be83-361a4209dd3e"} ] Each instance is managed without considering the propagation constraint of relations. POST /sharing/contexts/{CONTEXT_UUID}?operation=PUT(ADD|REMOVE)&[dryRun=true] e.g POST /resource-registry/contexts/67062c11-9c3a-4906-870d-7df6a43408b0?operation=ADD&dryRun=true POST /resource-registry/contexts/67062c11-9c3a-4906-870d-7df6a43408b0?operation=REMOVE where 67062c11-9c3a-4906-870d-7df6a43408b0/ is the Context UUID The body contains the list of instances to add/remove to/from the context identified by CONTEXT_UUID
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException
        org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      • addRemove

        @POST
        @Path("/contexts/{CONTEXT_UUID}/{TYPE_NAME}/{UUID}")
        @Produces("application/json;charset=UTF-8")
        public String addRemove​(@PathParam("CONTEXT_UUID")
                                String contextId,
                                @PathParam("TYPE_NAME")
                                String type,
                                @PathParam("UUID")
                                String instanceId,
                                @QueryParam("operation")
                                org.gcube.informationsystem.resourceregistry.api.rest.SharingPath.SharingOperation operation,
                                @QueryParam("dryRun") @DefaultValue("false")
                                Boolean dryRun,
                                @QueryParam("forceAddToContext") @DefaultValue("false")
                                Boolean forceAddToContext)
                         throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException,
                                org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException,
                                org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Add/Remove an instance from context. The operation can have a cascade effect due to propagation constraint. Return the list of instances affected by an add/remove to/from context the target instance identified by UUID path parameter POST /sharing/contexts/{CONTEXT_UUID}/{TYPE_NAME}/{UUID}?operation=(ADD|REMOVE)&dryRun=true] e.g POST /resource-registry/sharing/contexts/67062c11-9c3a-4906-870d-7df6a43408b0/HostingNode/16032d09-3823-444e-a1ff-a67de4f350a8?operation=ADD&dryRun=true POST /resource-registry/sharing/contexts/67062c11-9c3a-4906-870d-7df6a43408b0/HostingNode/16032d09-3823-444e-a1ff-a67de4f350a8?operation=REMOVE&dryRun=true where 67062c11-9c3a-4906-870d-7df6a43408b0 is the Context UUID and 16032d09-3823-444e-a1ff-a67de4f350a8 is the HostingNode UUID
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException
        org.gcube.informationsystem.resourceregistry.api.exceptions.entities.resource.ResourceNotFoundException
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException