Class ContextManager


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

      • ContextManager

        public ContextManager()
    • Method Detail

      • all

        @GET
        @Consumes({"text/plain","application/json;charset=UTF-8"})
        @Produces("application/json;charset=UTF-8")
        public String all()
                   throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                          org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        GET /contexts It returns the list of contexts as Json Array. Depending on the role and the requested parameter the json defining the context could contain minimal information. Only IS-Manager and Infrastructure-Manager are allowed to get all the information about contexts such as: - not obfuscated metadata (i.e. createdBy and lastUpdateBy) - context state IS-Manager and Infrastructure-Manager get the metadata by default even not requested. Other users requesting must explicitly request the metadata to get them but they will always receive obfuscated createdBy and lastUpdateBy properties.
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      • read

        @GET
        @Path("{CONTEXT_UUID}")
        @Consumes({"text/plain","application/json;charset=UTF-8"})
        @Produces("application/json;charset=UTF-8")
        public String read​(@PathParam("CONTEXT_UUID")
                           String uuid)
                    throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                           org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        GET /contexts/{UUID} e.g. GET /contexts/c0f314e7-2807-4241-a792-2a6c79ed4fd0
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      • updateCreate

        @PUT
        @Path("{CONTEXT_UUID}")
        @Consumes({"text/plain","application/json;charset=UTF-8"})
        @Produces("application/json;charset=UTF-8")
        public String updateCreate​(@PathParam("CONTEXT_UUID")
                                   String uuid,
                                   String json)
                            throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        PUT /contexts/{UUID} e.g. PUT /contexts/c0f314e7-2807-4241-a792-2a6c79ed4fd0 BODY: {...}
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      • changeState

        @Path("{CONTEXT_UUID}")
        @Consumes({"text/plain","application/json;charset=UTF-8"})
        public String changeState​(@PathParam("CONTEXT_UUID")
                                  String uuid,
                                  String json)
                           throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        PATCH /contexts/{UUID} e.g. PATCH /contexts/c0f314e7-2807-4241-a792-2a6c79ed4fd0 BODY: {...} The body contains the Contexts JSon representation only the state property will be evaluated in this method
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      • delete

        @DELETE
        @Consumes({"text/plain","application/json;charset=UTF-8"})
        @Path("{CONTEXT_UUID}")
        public javax.ws.rs.core.Response delete​(@PathParam("CONTEXT_UUID")
                                                String uuid)
                                         throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                                org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException