Class ContextManager
java.lang.Object
org.gcube.resourcemanagement.rest.BaseREST
org.gcube.resourcemanagement.rest.vremodelling.ContextManager
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe path parameter for context UUIDstatic final StringThe path part for contexts endpointsstatic final StringThe path part for current contextFields inherited from class org.gcube.resourcemanagement.rest.BaseREST
APPLICATION_JSON_API, APPLICATION_JSON_CHARSET_UTF_8, COUNT_KEY, httpHeaders, LOCATION_HEADER, logger, PURGE_QUERY_PARAMETER, uriInfo -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreate a new Context using the provided definition POST /contexts BODY: {...}jakarta.ws.rs.core.ResponseDelete a context by its UUID DELETE /contexts/{UUID} e.g.Allow to read the Context definition GET /contexts/{UUID} e.g.Update an existing Context definition PUT /contexts/{UUID} e.g.Methods inherited from class org.gcube.resourcemanagement.rest.BaseREST
addLocation, createCountJson, setAccountingMethod
-
Field Details
-
CONTEXTS_PATH_PART
The path part for contexts endpoints- See Also:
-
CONTEXT_UUID_PATH_PARAMETER
The path parameter for context UUID- See Also:
-
CURRENT_CONTEXT_PATH_PART
The path part for current context- See Also:
-
-
Constructor Details
-
ContextManager
public ContextManager()Default constructor for ContextManager
-
-
Method Details
-
create
@POST @Path("{CONTEXT_UUID}") @Consumes({"text/plain","application/json;charset=UTF-8"}) @Produces("application/json;charset=UTF-8") public String create(String json) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException, jakarta.ws.rs.WebApplicationException Create a new Context using the provided definition POST /contexts BODY: {...}- Parameters:
json- the context definition in JSON format- Returns:
- the created context as JSON string
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if there's an error in the resource registryjakarta.ws.rs.WebApplicationException- if the request is invalid
-
read
@GET @Path("{CONTEXT_UUID}") @Produces("application/json;charset=UTF-8") public String read(@PathParam("CONTEXT_UUID") String uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException, jakarta.ws.rs.WebApplicationException Allow to read the Context definition GET /contexts/{UUID} e.g. GET /contexts/c0f314e7-2807-4241-a792-2a6c79ed4fd0- Parameters:
uuid- the UUID of the context to read- Returns:
- the context definition as JSON string
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if there's an error in the resource registryjakarta.ws.rs.WebApplicationException- if the request is invalid
-
update
@PUT @Path("{CONTEXT_UUID}") @Consumes({"text/plain","application/json;charset=UTF-8"}) @Produces("application/json;charset=UTF-8") public String update(@PathParam("CONTEXT_UUID") String uuid, String json) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException, jakarta.ws.rs.WebApplicationException Update an existing Context definition PUT /contexts/{UUID} e.g. PUT /contexts/c0f314e7-2807-4241-a792-2a6c79ed4fd0 BODY: {...}- Parameters:
uuid- the UUID of the context to updatejson- the updated context definition in JSON format- Returns:
- the updated context as JSON string
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if there's an error in the resource registryjakarta.ws.rs.WebApplicationException- if the request is invalid
-
delete
@DELETE @Consumes({"text/plain","application/json;charset=UTF-8"}) @Path("{CONTEXT_UUID}") public jakarta.ws.rs.core.Response delete(@PathParam("CONTEXT_UUID") String uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException, jakarta.ws.rs.WebApplicationException Delete a context by its UUID DELETE /contexts/{UUID} e.g. DELETE /contexts/c0f314e7-2807-4241-a792-2a6c79ed4fd0- Parameters:
uuid- the UUID of the context to delete- Returns:
- Response indicating the result of the delete operation
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if there's an error in the resource registryjakarta.ws.rs.WebApplicationException- if the request is invalid
-