Class QueryTemplateManager
java.lang.Object
org.gcube.informationsystem.resourceregistry.rest.base.BaseRest
org.gcube.informationsystem.resourceregistry.rest.core.QueryTemplateManager
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe path parameter name for identifying a query template by name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjakarta.ws.rs.core.Responseall()Returns the paginated list of Query Templates for the current caller.jakarta.ws.rs.core.ResponseDeletes a query template with the specified name from the Resource Registry.jakarta.ws.rs.core.ResponseReturns the paginated result of executing a JSON query against the Query Template collection.Retrieves a specific query template by its name from the Resource Registry.jakarta.ws.rs.core.ResponseReturns the paginated result of executing the query template with the specified name and parameters.jakarta.ws.rs.core.ResponseupdateCreate(String queryTemplateName, String json) Creates or fully replaces the Query Template identified by its name.Methods inherited from class org.gcube.informationsystem.resourceregistry.rest.base.BaseRest
buildResponse, buildResponse, setAccountingMethod, setAccountingMethod
-
Field Details
-
QUERY_TEMPLATE_NAME_PATH_PARAMETER
The path parameter name for identifying a query template by name.- See Also:
-
-
Constructor Details
-
QueryTemplateManager
public QueryTemplateManager()Creates a newQueryTemplateManagerinstance.
-
-
Method Details
-
all
@GET @Produces("application/json") public jakarta.ws.rs.core.Response all() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionReturns the paginated list of Query Templates for the current caller.- Returns:
- JAX-RS response containing the JSON array of Query Template definitions
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the database lookup fails
-
updateCreate
@PUT @Path("{query-template-name}") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response updateCreate(@PathParam("query-template-name") String queryTemplateName, String json) throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Creates or fully replaces the Query Template identified by its name.- Parameters:
queryTemplateName- The name of the query template to create or update (must match the "name" field in the JSON body)json- JSON representation of the query template to create or update- Returns:
- JSON object containing the created or updated query template with its properties and metadata (if requested)
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException- If the query template definition is invalidorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- If an error occurs during query template creation or update
-
read
@GET @Path("{query-template-name}") @Produces("application/json") public String read(@PathParam("query-template-name") String queryTemplateName) throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Retrieves a specific query template by its name from the Resource Registry.- Parameters:
queryTemplateName- The name of the query template to retrieve- Returns:
- JSON object containing the requested query template with its properties and metadata (if requested)
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException- If the query template with the specified name does not existorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- If an error occurs during query template retrieval
-
run
@Path("{query-template-name}") @Consumes("application/json") @Produces("application/json") public jakarta.ws.rs.core.Response run(@PathParam("query-template-name") String queryTemplateName, String params) throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Returns the paginated result of executing the query template with the specified name and parameters.- Parameters:
queryTemplateName- the name of the query template to executeparams- JSON object containing parameter values for template substitution- Returns:
- JAX-RS response containing the JSON array of query results
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException- if the query template with the specified name does not existorg.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException- if the query execution fails due to invalid parameters or query structureorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if an error occurs during query template execution
-
delete
@DELETE @Path("{query-template-name}") public jakarta.ws.rs.core.Response delete(@PathParam("query-template-name") String queryTemplateName) throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Deletes a query template with the specified name from the Resource Registry.- Parameters:
queryTemplateName- the exact name of the query template to delete- Returns:
- HTTP 204 No Content response upon successful deletion
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException- if the query template with the specified name does not existorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if an error occurs during query template deletion
-
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 Returns the paginated result of executing a JSON query against the Query Template collection.- Parameters:
jsonQuery- JSON object describing the Query Template structure to search for- Returns:
- JAX-RS response containing the JSON array of matching Query Template 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
-