Class TypeManager
java.lang.Object
org.gcube.informationsystem.resourceregistry.rest.base.BaseRest
org.gcube.informationsystem.resourceregistry.rest.admin.TypeManager
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant representing the type name path parameter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.ResponseRegisters or idempotently confirms a Type definition.jakarta.ws.rs.core.ResponseDeletes an unreferenced, uninstantiated Type definition by case-sensitive name.jakarta.ws.rs.core.ResponseExecutes a paginated JSON Query-By-Example against the Types collection.Reads a Type definition and its requested descendant closure by case-sensitive name.Methods inherited from class org.gcube.informationsystem.resourceregistry.rest.base.BaseRest
buildResponse, buildResponse, setAccountingMethod, setAccountingMethod
-
Field Details
-
TYPE_PATH_PARAMETER
Constant representing the type name path parameter.- See Also:
-
-
Constructor Details
-
TypeManager
public TypeManager()Creates a new, uninitializedTypeManagerinstance.
-
-
Method Details
-
query
@Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response query(String jsonQuery) throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Executes a paginated JSON Query-By-Example against the Types collection.- Parameters:
jsonQuery- JSON object describing the Type definition structure to search for- Returns:
- JAX-RS response containing the JSON array of matching Type definitions
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException- if the query syntax is invalidorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the database lookup fails
-
create
@PUT @Path("{type-name}") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response create(@PathParam("type-name") String typeName, String json) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Registers or idempotently confirms a Type definition.- Parameters:
typeName- the name of the Type to createjson- the complete JSON Type definition- Returns:
- a JAX-RS response containing the created Type definition
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaException- if the Type schema is invalid or conflicts with rulesorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if a registry database error occurs
-
read
@GET @Path("{type-name}") @Produces("application/json") public String read(@PathParam("type-name") String type) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Reads a Type definition and its requested descendant closure by case-sensitive name.- Parameters:
type- the case-sensitive name of the type to retrieve- Returns:
- the JSON representation of the type definition
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException- if the type is not foundorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if a registry database error occurs
-
delete
@DELETE @Path("{type-name}") public jakarta.ws.rs.core.Response delete(@PathParam("type-name") String type) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Deletes an unreferenced, uninstantiated Type definition by case-sensitive name.- Parameters:
type- the case-sensitive name of the type to delete- Returns:
- HTTP 204 No Content on successful deletion
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException- if the type is not foundorg.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException- if the type has concrete instances, subtypes, or dependenciesorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if a registry database error occurs
-