Class Access
- java.lang.Object
-
- org.gcube.informationsystem.resourceregistry.rest.BaseRest
-
- org.gcube.informationsystem.resourceregistry.rest.Access
-
@Path("access") public class Access extends BaseRest- Author:
- Luca Frosini (ISTI - CNR)
-
-
Field Summary
Fields Modifier and Type Field Description static StringREFERENCE_TYPE_PATH_PARAMETERstatic StringRELATION_TYPE_PATH_PARAMETERstatic StringRESOURCE_TYPE_PATH_PARAMETER
-
Constructor Summary
Constructors Constructor Description Access()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetAllContexts()StringgetAllInstances(String type, Boolean polymorphic)StringgetAllResourcesHavingFacet(String resourcetype, String relationType, String referenceType, String reference, Boolean polymorphic, String direction, javax.ws.rs.core.UriInfo uriInfo)StringgetContext(String uuid)StringgetInstance(String type, String uuid)StringgetInstanceContexts(String type, String instanceId)StringgetType(String type, Boolean polymorphic)StringgraphQuery(String query, Boolean raw)It includeSubtypes to query Entities and Relations in the current Context.
It accepts idempotent query only..javax.ws.rs.core.ResponseinstanceExists(String type, String uuid)StringjsonQuery(String jsonQuery)POST /access/query Content Body example: { "@class": "EService", "consistsOf": [ { "@class": "ConsistsOf", "propagationConstraint" : { "add": "propagate" }, "target": { "@class": "StateFacet", "value": "down" } }, { "@class": "IsIdentifiedBy", "target": { "@class": "SoftwareFacet", "name": "data-transfer-service", "group": "DataTransfer" } }, { "@class": "ConsistsOf", "target": { "@class": "AccessPointFacet", "endpoint": "http://pc-frosini.isti.cnr.it:8080/data-transfer-service/gcube/service" } } ] }-
Methods inherited from class org.gcube.informationsystem.resourceregistry.rest.BaseRest
checkHierarchicalMode, checkIncludeInstancesContexts, isRequesterAllowedToPerformHierarchicalRequests, isRequesterAllowedToRequestInstancesContexts
-
-
-
-
Field Detail
-
RESOURCE_TYPE_PATH_PARAMETER
public static final String RESOURCE_TYPE_PATH_PARAMETER
- See Also:
- Constant Field Values
-
RELATION_TYPE_PATH_PARAMETER
public static final String RELATION_TYPE_PATH_PARAMETER
- See Also:
- Constant Field Values
-
REFERENCE_TYPE_PATH_PARAMETER
public static final String REFERENCE_TYPE_PATH_PARAMETER
- See Also:
- Constant Field Values
-
-
Method Detail
-
getAllContexts
@GET @Path("contexts") @Produces("application/json;charset=UTF-8") public String getAllContexts() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getContext
@GET @Path("contexts/{UUID}") @Produces("application/json;charset=UTF-8") public String getContext(@PathParam("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
-
getType
@GET @Path("types/{TYPE_NAME}") @Produces("application/json;charset=UTF-8") public String getType(@PathParam("TYPE_NAME") String type, @QueryParam("polymorphic") @DefaultValue("false") Boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getAllInstances
@GET @Path("instances/{TYPE_NAME}") @Produces("application/json;charset=UTF-8") public String getAllInstances(@PathParam("TYPE_NAME") String type, @QueryParam("polymorphic") @DefaultValue("true") Boolean polymorphic) throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
instanceExists
@HEAD @Path("instances/{TYPE_NAME}/{UUID}") @Produces("application/json;charset=UTF-8") public javax.ws.rs.core.Response instanceExists(@PathParam("TYPE_NAME") String type, @PathParam("UUID") String uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getInstance
@GET @Path("instances/{TYPE_NAME}/{UUID}") @Produces("application/json;charset=UTF-8") public String getInstance(@PathParam("TYPE_NAME") String type, @PathParam("UUID") String uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getInstanceContexts
@GET @Path("instances/{TYPE_NAME}/{UUID}/contexts") @Produces("application/json;charset=UTF-8") public String getInstanceContexts(@PathParam("TYPE_NAME") String type, @PathParam("UUID") String instanceId) throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
graphQuery
@GET @Path("query") @Produces("application/json;charset=UTF-8") public String graphQuery(@QueryParam("q") String query, @QueryParam("raw") @DefaultValue("false") Boolean raw) throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryExceptionIt includeSubtypes to query Entities and Relations in the current Context.
It accepts idempotent query only..
For query syntax please refer to
https://orientdb.com/docs/last/SQL-Syntax.html
e.g. GET /access/query?q=SELECT FROM V- Parameters:
query- Defines the query to send to the backend.raw- request a raw response (not a Element based response)- Returns:
- The JSON representation of the result
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException- if the query is invalid or not idempotent
-
jsonQuery
@POST @Path("query") public String jsonQuery(String jsonQuery) throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionPOST /access/query Content Body example: { "@class": "EService", "consistsOf": [ { "@class": "ConsistsOf", "propagationConstraint" : { "add": "propagate" }, "target": { "@class": "StateFacet", "value": "down" } }, { "@class": "IsIdentifiedBy", "target": { "@class": "SoftwareFacet", "name": "data-transfer-service", "group": "DataTransfer" } }, { "@class": "ConsistsOf", "target": { "@class": "AccessPointFacet", "endpoint": "http://pc-frosini.isti.cnr.it:8080/data-transfer-service/gcube/service" } } ] }- Parameters:
jsonQuery-- Returns:
- the result as JSON String
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryExceptionorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
getAllResourcesHavingFacet
@GET @Path("query/{RESOURCE_TYPE_NAME}/{RELATION_TYPE_NAME}/{REFERENCE_TYPE_NAME}") @Produces("application/json;charset=UTF-8") public String getAllResourcesHavingFacet(@PathParam("RESOURCE_TYPE_NAME") String resourcetype, @PathParam("RELATION_TYPE_NAME") String relationType, @PathParam("REFERENCE_TYPE_NAME") String referenceType, @QueryParam("_reference") String reference, @QueryParam("_polymorphic") @DefaultValue("false") Boolean polymorphic, @QueryParam("_direction") @DefaultValue("out") String direction, @Context javax.ws.rs.core.UriInfo uriInfo) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
-
-