java.lang.Object
org.gcube.informationsystem.resourceregistry.rest.base.BaseRest
org.gcube.informationsystem.resourceregistry.rest.admin.TypeManager

@Path("types") public class TypeManager extends BaseRest
Author:
Luca Frosini (ISTI - CNR)
  • Field Details

    • TYPE_PATH_PARAMETER

      public static final String TYPE_PATH_PARAMETER
      Constant representing the type name path parameter.
      See Also:
  • Constructor Details

    • TypeManager

      public TypeManager()
      Creates a new, uninitialized TypeManager instance.
  • 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 invalid
      org.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 create
      json - 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 rules
      org.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 found
      org.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 found
      org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaViolationException - if the type has concrete instances, subtypes, or dependencies
      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if a registry database error occurs