Class ContextManager
- java.lang.Object
-
- org.gcube.informationsystem.resourceregistry.rest.BaseRest
-
- org.gcube.informationsystem.resourceregistry.rest.ContextManager
-
@Path("contexts") public class ContextManager extends BaseRest- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONTEXT_UUID_PATH_PARAMETER
-
Constructor Summary
Constructors Constructor Description ContextManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringall()GET /contexts It returns the list of contexts as Json Array.StringchangeState(String uuid, String json)PATCH /contexts/{UUID} e.g.javax.ws.rs.core.Responsedelete(String uuid)Stringread(String uuid)GET /contexts/{UUID} e.g.StringupdateCreate(String uuid, String json)PUT /contexts/{UUID} e.g.-
Methods inherited from class org.gcube.informationsystem.resourceregistry.rest.BaseRest
initRequestInfo, initRequestInfo, setAccountingMethod, setAccountingMethod
-
-
-
-
Field Detail
-
CONTEXT_UUID_PATH_PARAMETER
public static final String CONTEXT_UUID_PATH_PARAMETER
- See Also:
- Constant Field Values
-
-
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.ResourceRegistryExceptionGET /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.ContextNotFoundExceptionorg.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.ResourceRegistryExceptionGET /contexts/{UUID} e.g. GET /contexts/c0f314e7-2807-4241-a792-2a6c79ed4fd0- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundExceptionorg.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.ResourceRegistryExceptionPUT /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.ResourceRegistryExceptionPATCH /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.ContextNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
-