Class Access


  • @Path("access")
    public class Access
    extends BaseRest
    Author:
    Luca Frosini (ISTI - CNR)
    • Constructor Detail

      • Access

        public Access()
    • 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.ContextNotFoundException
        org.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.SchemaNotFoundException
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      • allQueryTemplates

        @GET
        @Path("query-templates")
        @Consumes({"text/plain","application/json;charset=UTF-8"})
        @Produces("application/json;charset=UTF-8")
        public String allQueryTemplates()
                                 throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException,
                                        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      • readQueryTemplate

        @GET
        @Path("query-templates/{QUERY_TEMPLATE_NAME}")
        @Produces("application/json;charset=UTF-8")
        public String readQueryTemplate​(@PathParam("QUERY_TEMPLATE_NAME")
                                        String queryTemplateName)
                                 throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException,
                                        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
      • runQueryTemplate

        @POST
        @Path("query-templates/{QUERY_TEMPLATE_NAME}")
        @Produces("application/json;charset=UTF-8")
        public String runQueryTemplate​(@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
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException
        org.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.NotFoundException
        org.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.NotFoundException
        org.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.NotFoundException
        org.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.NotFoundException
        org.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.InvalidQueryException
        It 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.ResourceRegistryException
        POST /access/query Content Body example: { "": "EService", "consistsOf": [ { "": "ConsistsOf", "propagationConstraint" : { "add": "propagate" }, "target": { "": "StateFacet", "value": "down" } }, { "": "IsIdentifiedBy", "target": { "": "SoftwareFacet", "name": "data-transfer-service", "group": "DataTransfer" } }, { "": "ConsistsOf", "target": { "": "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.InvalidQueryException
        org.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