Class ResourceRegistryClientImpl

  • All Implemented Interfaces:
    org.gcube.informationsystem.resourceregistry.api.request.RequestInfo, ResourceRegistryClient

    public class ResourceRegistryClientImpl
    extends org.gcube.informationsystem.resourceregistry.api.request.BaseRequestInfo
    implements ResourceRegistryClient
    Default ResourceRegistryClient implementation. Talks to the Resource Registry service over HTTP via GXRequest, translating each interface method into the corresponding /access/... request, applying the client-side query parameter configuration (metadata policy, hierarchical mode, contexts policy, membership scope, pagination) inherited from BaseRequestInfo, and unmarshalling the JSON response into model objects. A ContextCache and a TypesKnowledge base are used to avoid round-trips for context and type lookups; the *FromServer methods bypass both caches and always hit the server directly.
    Author:
    Luca Frosini (ISTI - CNR)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected String address
      The base address of the Resource Registry service
      protected org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache contextCache
      Cache for context information
      protected org.gcube.informationsystem.resourceregistry.api.contexts.ContextCacheRenewal contextCacheRenewal
      Context cache renewal strategy that reads all contexts from the server
      protected Map<String,​String> headers
      Additional HTTP headers to be included in requests
      protected org.gcube.informationsystem.types.knowledge.TypesKnowledge typesKnowledge
      Knowledge base for type information
      • Fields inherited from class org.gcube.informationsystem.resourceregistry.api.request.BaseRequestInfo

        allMeta, contextsPolicy, hierarchicalMode, includeMeta, limit, membershipScope, offset
      • Fields inherited from interface org.gcube.informationsystem.resourceregistry.api.request.RequestInfo

        DEFAULT_LIMIT, DEFAULT_OFFSET, UNBOUNDED_LIMIT
    • Constructor Summary

      Constructors 
      Constructor Description
      ResourceRegistryClientImpl​(String address)
      Creates a new ResourceRegistryClientImpl with default configuration.
      ResourceRegistryClientImpl​(String address, boolean sharedContextCache, boolean sharedModelKnowledge)
      Creates a new ResourceRegistryClientImpl with configurable cache and knowledge sharing.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      protected List<org.gcube.informationsystem.types.reference.Type> addChildren​(org.gcube.informationsystem.dag.Node<org.gcube.informationsystem.types.reference.Type> node, List<org.gcube.informationsystem.types.reference.Type> types, int currentLevel, int maxLevel)
      Adds child types in stable breadth-first order, once per type name.
      void addHeader​(String name, boolean value)
      Adds a custom HTTP header to be included in requests.
      void addHeader​(String name, String value)
      Adds a custom HTTP header to be included in requests.
      boolean existContext​(String uuid)
      Checks if a context with the specified UUID (as string) exists in the system using internal cache.
      boolean existContext​(UUID uuid)
      Checks if a context with the specified UUID exists in the system using internal cache.
      <ERElem extends org.gcube.informationsystem.model.reference.ERElement>
      boolean
      existInstance​(Class<ERElem> clazz, UUID uuid)
      Checks if an Information System element instance exists in the Resource Registry using class and UUID.
      boolean existInstance​(String type, UUID uuid)
      Checks if an Information System element instance exists in the Resource Registry using type name and UUID.
      boolean existQueryTemplate​(String queryTemplateName)
      Checks if a query template exists in the Resource Registry using template name.
      boolean existQueryTemplate​(org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate queryTemplate)
      Checks if a query template exists in the Resource Registry.
      <ME extends org.gcube.informationsystem.model.reference.ModelElement>
      boolean
      existType​(Class<ME> clazz)
      Checks if a type definition exists in the Information System using a model element class.
      boolean existType​(String typeName)
      Checks if a type definition exists in the Information System using the type name.
      boolean existTypeFromServer​(String typeName)
      Checks if a type exists by querying the server directly, bypassing the local knowledge cache.
      List<org.gcube.informationsystem.contexts.reference.entities.Context> getAllContextFromServer()
      Retrieves the list of all contexts in the system.
      protected List<org.gcube.informationsystem.contexts.reference.entities.Context> getAllContextFromServer​(boolean includeMeta, Integer offset, Integer limit)
      It reads all the contexts from the server with specific parameters.
      List<org.gcube.informationsystem.contexts.reference.entities.Context> getAllContexts()
      Retrieves all available contexts using internal cache.
      List<org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate> getAllQueryTemplates()
      Retrieves one configured page of global Query Templates.
      org.gcube.informationsystem.contexts.reference.entities.Context getContext​(String uuid)
      Retrieves a specific context by its UUID (as string) using internal cache.
      org.gcube.informationsystem.contexts.reference.entities.Context getContext​(String uuid, int depth)
      org.gcube.informationsystem.contexts.reference.entities.Context getContext​(UUID uuid)
      Retrieves a specific context by its UUID using internal cache.
      org.gcube.informationsystem.contexts.reference.entities.Context getContext​(UUID uuid, int depth)
      Retrieves the Context identified by the given UUID directly from the server, expanding its descendant subtree up to the given depth.
      org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache getContextCache()
      Gets the context cache used for context-related operations.
      protected org.gcube.informationsystem.contexts.reference.entities.Context getContextFromServer​(String uuid)
      It reads the context from server by UUID string.
      protected org.gcube.informationsystem.contexts.reference.entities.Context getContextFromServer​(String uuid, int depth)
      It reads the context from server by UUID string or literal path segment (e.g.
      org.gcube.informationsystem.contexts.reference.entities.Context getContextFromServer​(UUID uuid)
      It reads the context from server by UUID.
      List<org.gcube.informationsystem.model.reference.properties.Event> getContextHistory​(String uuid)
      List<org.gcube.informationsystem.model.reference.properties.Event> getContextHistory​(UUID uuid)
      Reads the event history/audit trail of the Context identified by the given UUID.
      org.gcube.informationsystem.contexts.reference.entities.Context getCurrentContext()
      Retrieves the current context associated with the client's authorization token using internal cache.
      org.gcube.informationsystem.contexts.reference.entities.Context getCurrentContext​(int depth)
      Retrieves the context associated with the caller's current authorization token directly from the server, expanding its descendant subtree up to the given depth.
      <R extends org.gcube.informationsystem.model.reference.entities.Resource,​C extends org.gcube.informationsystem.model.reference.relations.ConsistsOf<?,​?>,​F extends org.gcube.informationsystem.model.reference.entities.Facet>
      List<R>
      getFilteredResources​(Class<R> resourceClass, Class<C> consistsOfClass, Class<F> facetClass, boolean polymorphic, Map<String,​String> facetConstraint)
      Deprecated.
      String getFilteredResources​(String resourceType, String consistsOfType, String facetType, boolean polymorphic, Map<String,​String> facetConstraint)
      Deprecated.
      protected org.gcube.common.gxhttp.request.GXRequest getGXRequest()
      Creates and configures a new HTTP request with authorization headers and custom headers.
      <ERElem extends org.gcube.informationsystem.model.reference.ERElement>
      ERElem
      getInstance​(Class<ERElem> clazz, UUID uuid)
      Reads an existing instance from the Resource Registry by its type class and UUID.
      String getInstance​(String type, UUID uuid)
      Reads an existing instance from the Resource Registry by its type name and UUID.
      <ERElem extends org.gcube.informationsystem.model.reference.ERElement>
      Map<UUID,​String>
      getInstanceContexts​(Class<ERElem> clazz, UUID uuid)
      Retrieves the list of contexts where a specific Information System element is present in the Resource Registry.
      Map<UUID,​String> getInstanceContexts​(String type, UUID uuid)
      Retrieves the list of contexts where a specific Information System element is present in the Resource Registry.
      <ERElem extends org.gcube.informationsystem.model.reference.ERElement>
      List<ERElem>
      getInstances​(Class<ERElem> clazz, Boolean polymorphic)
      Retrieves all instances of the specified type from the Resource Registry.
      String getInstances​(String type, Boolean polymorphic)
      Retrieves all instances of the specified type from the Resource Registry as JSON string.
      org.gcube.informationsystem.model.knowledge.ModelKnowledge<org.gcube.informationsystem.types.reference.Type,​org.gcube.informationsystem.types.knowledge.SchemaTypeInformation> getModelKnowledge()
      Retrieves the complete model knowledge containing type definitions and their information.
      <R extends org.gcube.informationsystem.model.reference.entities.Resource,​I extends org.gcube.informationsystem.model.reference.relations.IsRelatedTo<?,​?>,​RR extends org.gcube.informationsystem.model.reference.entities.Resource>
      List<R>
      getRelatedResources​(Class<R> resourceClass, Class<I> isRelatedToClass, Class<RR> referenceResourceClass, org.gcube.informationsystem.base.reference.Direction direction, boolean polymorphic)
      Deprecated.
      String getRelatedResources​(String resourceType, String isRelatedToType, String referenceResourceType, org.gcube.informationsystem.base.reference.Direction direction, boolean polymorphic)
      Deprecated.
      <R extends org.gcube.informationsystem.model.reference.entities.Resource,​I extends org.gcube.informationsystem.model.reference.relations.IsRelatedTo<?,​?>,​RR extends org.gcube.informationsystem.model.reference.entities.Resource>
      List<R>
      getRelatedResourcesFromReferenceResource​(Class<R> resourceClass, Class<I> isRelatedToClass, Class<RR> referenceResourceClass, UUID referenceResourceUUID, org.gcube.informationsystem.base.reference.Direction direction, boolean polymorphic)
      Deprecated.
      <R extends org.gcube.informationsystem.model.reference.entities.Resource,​I extends org.gcube.informationsystem.model.reference.relations.IsRelatedTo<?,​?>,​RR extends org.gcube.informationsystem.model.reference.entities.Resource>
      List<R>
      getRelatedResourcesFromReferenceResource​(Class<R> resourceClass, Class<I> isRelatedToClass, RR referenceResource, org.gcube.informationsystem.base.reference.Direction direction, boolean polymorphic)
      Deprecated.
      String getRelatedResourcesFromReferenceResource​(String resourceType, String isRelatedToType, String referenceResourceType, UUID referenceResourceUUID, org.gcube.informationsystem.base.reference.Direction direction, boolean polymorphic)
      Deprecated.
      <R extends org.gcube.informationsystem.model.reference.entities.Resource,​C extends org.gcube.informationsystem.model.reference.relations.ConsistsOf<?,​?>,​F extends org.gcube.informationsystem.model.reference.entities.Facet>
      List<R>
      getResourcesFromReferenceFacet​(Class<R> resourceClass, Class<C> consistsOfClass, F referenceFacet, boolean polymorphic)
      Deprecated.
      <R extends org.gcube.informationsystem.model.reference.entities.Resource,​C extends org.gcube.informationsystem.model.reference.relations.ConsistsOf<?,​?>,​F extends org.gcube.informationsystem.model.reference.entities.Facet>
      List<R>
      getResourcesFromReferenceFacet​(Class<R> resourceClass, Class<C> consistsOfClass, Class<F> facetClass, UUID referenceFacetUUID, boolean polymorphic)
      Deprecated.
      String getResourcesFromReferenceFacet​(String resourceType, String consistsOfType, String facetType, UUID referenceFacetUUID, boolean polymorphic)
      Deprecated.
      <ME extends org.gcube.informationsystem.model.reference.ModelElement>
      List<org.gcube.informationsystem.types.reference.Type>
      getType​(Class<ME> clazz, int level)
      Type-safe counterpart of ResourceRegistryClient.getType(String, int) using the class-derived type name.
      <ME extends org.gcube.informationsystem.model.reference.ModelElement>
      List<org.gcube.informationsystem.types.reference.Type>
      getType​(Class<ME> clazz, Boolean polymorphic)
      Type-safe counterpart of ResourceRegistryClient.getType(String, Boolean) using the class-derived type name.
      String getType​(String typeName, int level)
      Reads a case-sensitive type from the local snapshot with breadth-first depth 0, a positive depth, or -1; values below -1 fall back to root-only depth 0.
      String getType​(String typeName, Boolean polymorphic)
      Reads a case-sensitive type from the local type snapshot; true includes every descendant, while false or null returns only the requested type.
      <ME extends org.gcube.informationsystem.model.reference.ModelElement>
      org.gcube.informationsystem.dag.Node<org.gcube.informationsystem.types.reference.Type>
      getTypeDagNode​(Class<ME> clazz)
      Retrieves the type DAG node for a specific type identified by its model element class.
      org.gcube.informationsystem.dag.Node<org.gcube.informationsystem.types.reference.Type> getTypeDagNode​(String typeName)
      Retrieves the type DAG node for a specific type identified by its name.
      <ME extends org.gcube.informationsystem.model.reference.ModelElement>
      List<org.gcube.informationsystem.types.reference.Type>
      getTypeFromServer​(Class<ME> clazz, int depth)
      Gets type information directly from the server with specific depth, bypassing the local cache.
      <ME extends org.gcube.informationsystem.model.reference.ModelElement>
      List<org.gcube.informationsystem.types.reference.Type>
      getTypeFromServer​(Class<ME> clazz, Boolean polymorphic)
      Deprecated.
      Use getTypeFromServer(Class, int) with depth instead.
      String getTypeFromServer​(String typeName, int depth)
      Reads GET /access/types/{type-name} directly with depth and metadataPolicy; invocation metadata policy overrides client configuration.
      String getTypeFromServer​(String typeName, Boolean polymorphic)
      Deprecated.
      Use getTypeFromServer(String, int) with depth instead.
      <ERElem extends org.gcube.informationsystem.model.reference.ERElement>
      List<org.gcube.informationsystem.types.reference.Type>
      getTypeFromTypesKnowledge​(String typeName, int level)
      Gets type information from the local types knowledge cache with level limitation.
      <ERElem extends org.gcube.informationsystem.model.reference.ERElement>
      List<org.gcube.informationsystem.types.reference.Type>
      getTypeFromTypesKnowledge​(String typeName, Boolean polymorphic)
      Gets type information from the local types knowledge cache.
      <ERElem extends org.gcube.informationsystem.model.reference.ERElement>
      List<org.gcube.informationsystem.types.reference.Type>
      getTypeFromTypesKnowledge​(String typeName, Boolean polymorphic, int level)
      Gets type information from the local types knowledge cache with full configuration.
      <ME extends org.gcube.informationsystem.model.reference.ModelElement>
      org.gcube.informationsystem.dag.Node<org.gcube.informationsystem.types.reference.Type>
      getTypeTreeNode​(Class<ME> clazz)
      Deprecated.
      org.gcube.informationsystem.dag.Node<org.gcube.informationsystem.types.reference.Type> getTypeTreeNode​(String typeName)
      Deprecated.
      String jsonQuery​(String query)
      Executes a JSON Query-By-Example payload against the Instances collection.
      <E extends org.gcube.informationsystem.model.reference.entities.Entity>
      List<E>
      jsonQuery​(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)
      Typed overload of ResourceRegistryClient.jsonQuery(String), deserializing the JSON query result into strongly-typed Entity instances.
      String queryContexts​(String jsonQuery)
      Executes a JSON Query-By-Example payload against the Contexts collection.
      String queryQueryTemplates​(String jsonQuery)
      Executes a paginated JSON Query-By-Example payload against the global Query Template definitions, forwarding the configured limit, offset, and metadata policy.
      String queryTypes​(String jsonQuery)
      Executes a read-only JSON Query-By-Example payload against the global Types collection.
      String rawQuery​(String query)
      Deprecated.
      String rawQuery​(String query, boolean raw)
      Deprecated.
      org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate readQueryTemplate​(String queryTemplateName)
      Reads a global Query Template using its exact, case-sensitive name.
      org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate readQueryTemplate​(org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate queryTemplate)
      Reads the global Query Template whose exact name is carried by the supplied object.
      String readQueryTemplateAsString​(String queryTemplateName)
      Reads a global Query Template as JSON.
      void renewModelKnowledge()
      Forces a renewal of the cached model knowledge by fetching the latest version from the Resource Registry.
      String runQueryTemplate​(String name)
      Executes a query template and returns results as JSON string (deprecated method).
      String runQueryTemplate​(String name, String params)
      Executes a query template with string parameters and returns results as JSON string.
      String runQueryTemplate​(String name, org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)
      Executes a query template with JsonNode parameters and returns results as JSON string.
      String runQueryTemplate​(org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate queryTemplate)
      Executes a query template using template object and returns results as JSON string.
      String runQueryTemplate​(org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate queryTemplate, org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)
      Executes a query template using template object with JsonNode parameters and returns results as JSON string.
      • Methods inherited from class org.gcube.informationsystem.resourceregistry.api.request.BaseRequestInfo

        allMeta, getContextsPolicy, getLimit, getMembershipScope, getOffset, includeMeta, isHierarchicalMode, setAllMeta, setContextsPolicy, setHierarchicalMode, setIncludeMeta, setLimit, setMembershipScope, setOffset
      • Methods inherited from interface org.gcube.informationsystem.resourceregistry.api.request.RequestInfo

        allMeta, getContextsPolicy, getLimit, getMembershipScope, getOffset, includeMeta, isHierarchicalMode, serverResponses, setAllMeta, setContextsPolicy, setHierarchicalMode, setIncludeMeta, setLimit, setMembershipScope, setOffset
    • Field Detail

      • address

        protected final String address
        The base address of the Resource Registry service
      • headers

        protected Map<String,​String> headers
        Additional HTTP headers to be included in requests
      • contextCache

        protected org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache contextCache
        Cache for context information
      • typesKnowledge

        protected org.gcube.informationsystem.types.knowledge.TypesKnowledge typesKnowledge
        Knowledge base for type information
      • contextCacheRenewal

        protected org.gcube.informationsystem.resourceregistry.api.contexts.ContextCacheRenewal contextCacheRenewal
        Context cache renewal strategy that reads all contexts from the server
    • Constructor Detail

      • ResourceRegistryClientImpl

        public ResourceRegistryClientImpl​(String address)
        Creates a new ResourceRegistryClientImpl with default configuration. Uses shared context cache and shared model knowledge.
        Parameters:
        address - the base address of the Resource Registry service
      • ResourceRegistryClientImpl

        public ResourceRegistryClientImpl​(String address,
                                          boolean sharedContextCache,
                                          boolean sharedModelKnowledge)
        Creates a new ResourceRegistryClientImpl with configurable cache and knowledge sharing.
        Parameters:
        address - the base address of the Resource Registry service
        sharedContextCache - true to use shared context cache, false for dedicated cache
        sharedModelKnowledge - true to use shared model knowledge, false for dedicated knowledge
    • Method Detail

      • addHeader

        public void addHeader​(String name,
                              String value)
        Adds a custom HTTP header to be included in requests.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        addHeader in interface ResourceRegistryClient
        Parameters:
        name - Header name
        value - Header value
      • addHeader

        public void addHeader​(String name,
                              boolean value)
        Adds a custom HTTP header to be included in requests.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        addHeader in interface ResourceRegistryClient
        Parameters:
        name - Header name
        value - boolean value
      • getGXRequest

        protected org.gcube.common.gxhttp.request.GXRequest getGXRequest()
        Creates and configures a new HTTP request with authorization headers and custom headers.
        Returns:
        A configured GXRequest instance ready for use
      • getContextCache

        public org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache getContextCache()
        Gets the context cache used for context-related operations.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getContextCache in interface ResourceRegistryClient
        Returns:
        The context cache instance
      • getAllContexts

        public List<org.gcube.informationsystem.contexts.reference.entities.Context> getAllContexts()
                                                                                             throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves all available contexts using internal cache.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getAllContexts in interface ResourceRegistryClient
        Returns:
        List of all contexts accessible to the current user (from cache)
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If fails to retrieve contexts from cache or server
      • getAllContextFromServer

        public List<org.gcube.informationsystem.contexts.reference.entities.Context> getAllContextFromServer()
                                                                                                      throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves the list of all contexts in the system. Corresponding REST API: GET /access/contexts[?limit={limit}&offset={offset}&includeMeta={true|false}] Operation Behavior:
        • Returns all contexts that are accessible to the current user
        • Results are filtered based on user authorization and context access permissions
        • Supports pagination and metadata inclusion based on client configuration
        • Returns strongly-typed Context objects with role-appropriate detail level.
        Query Parameters limit (configurable via client configuration):
        • Maximum number of instances to return in a single response
        • Default value: server configuration dependent
        • Usage: client.setLimit(50)
        • Example: Set to 50 to get at most 50 instances per request
        • Query parameter: InstancePath.LIMIT_QUERY_PARAMETER.
        offset (configurable via client configuration):
        • Number of instances to skip from the beginning of the result set
        • Default value: 0
        • Usage: client.setOffset(10)
        • Example: Set to 10 to skip the first 10 instances (useful for pagination)
        • Query parameter: InstancePath.OFFSET_QUERY_PARAMETER.
        includeMeta (configurable via client configuration):
        • Whether to include metadata in the response instance
        • Default value: false (basic information only)
        • Usage: client.setIncludeMeta(true)
        • Values: true (includes metadata with role-based filtering) | false (basic information only)
        • Query parameter: InstancePath.METADATA_POLICY_QUERY_PARAMETER
        • Restriction: IS-Manager, Infrastructure-Manager, and Context-Manager see complete metadata including sensitive information (createdBy, lastUpdatedBy); other users see filtered metadata with sensitive fields obfuscated.
        Input Processing:
        • No input parameters required for this method
        • All contexts accessible to the current user are returned based on authorization level
        • Context filtering is automatically applied based on user permissions.
        Context Access:
        • Results include only contexts that the current user has permission to access
        • IS-Manager and Infrastructure-Manager see all contexts in the system
        • Context-Manager sees contexts within their management scope
        • Other users see contexts they have explicit access to.
        Authorization Requirements:
        • All users must have a valid token and basic read permissions to list contexts they have access to.
        Example Usage:
         ResourceRegistryClient client = ResourceRegistryClientFactory.create();
         
         // Basic usage - get all contexts with default settings
         List<Context> contexts = client.getContexts();
         
         // With metadata for non-admin users
         client.setIncludeMeta(true);
         List<Context> contextsWithMeta = client.getContexts();
         
         // With pagination
         client.setLimit(20);
         client.setOffset(10);
         List<Context> paginatedContexts = client.getContexts();
         
        Returns:
        List of Context objects with role-appropriate detail level accessible to the current user
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during context retrieval or if there are authorization issues
      • getAllContextFromServer

        protected List<org.gcube.informationsystem.contexts.reference.entities.Context> getAllContextFromServer​(boolean includeMeta,
                                                                                                                Integer offset,
                                                                                                                Integer limit)
                                                                                                         throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        It reads all the contexts from the server with specific parameters. The cache used for contexts is bypassed and not updated.
        Parameters:
        includeMeta - whether to include metadata in the response
        offset - the starting position for pagination
        limit - the maximum number of contexts to return
        Returns:
        All Contexts read from the server
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the retrieval
      • getModelKnowledge

        public org.gcube.informationsystem.model.knowledge.ModelKnowledge<org.gcube.informationsystem.types.reference.Type,​org.gcube.informationsystem.types.knowledge.SchemaTypeInformation> getModelKnowledge()
        Retrieves the complete model knowledge containing type definitions and their information. The model knowledge provides access to all registered types and their hierarchical relationships.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getModelKnowledge in interface ResourceRegistryClient
        Returns:
        the model knowledge containing type definitions and information
      • renewModelKnowledge

        public void renewModelKnowledge()
        Forces a renewal of the cached model knowledge by fetching the latest version from the Resource Registry. This method should be called when the schema has been modified and the local cache needs to be updated.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        renewModelKnowledge in interface ResourceRegistryClient
      • getContextFromServer

        public org.gcube.informationsystem.contexts.reference.entities.Context getContextFromServer​(UUID uuid)
                                                                                             throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                                                                                    org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        It reads the context from server by UUID. The cache used for contexts is bypassed and not updated. Corresponding REST API: GET /access/contexts/{context-uuid}[?includeMeta={true|false}] Operation Behavior:
        • Retrieves the context with the specified UUID from the system
        • Returns the complete context object with all accessible properties
        • Direct UUID-based context retrieval without additional processing.
        Query Parameters includeMeta (configurable via client configuration):
        • Whether to include metadata in the response instance
        • Default value: false (basic information only)
        • Usage: client.setIncludeMeta(true)
        • Values: true (includes metadata with role-based filtering) | false (basic information only)
        • Query parameter: InstancePath.METADATA_POLICY_QUERY_PARAMETER
        • Restriction: IS-Manager, Infrastructure-Manager, and Context-Manager see complete metadata including sensitive information (createdBy, lastUpdatedBy); other users see filtered metadata with sensitive fields obfuscated.
        Input Processing:
        • Accepts a properly formatted UUID object
        • No additional processing or conversion required
        • Direct UUID-based context retrieval.
        Context Access:
        • The context must be accessible to the current user based on authorization level
        • IS-Manager and Infrastructure-Manager can retrieve any context without restrictions
        • Context-Manager can retrieve contexts within their management scope
        • Other users can retrieve contexts they have explicit access to.
        Authorization Requirements:
        • All users must have a valid token and read permissions for the specific context to retrieve it.
        Example Usage:
         ResourceRegistryClient client = ResourceRegistryClientFactory.create();
         
         UUID contextUuid = UUID.fromString("c0f314e7-2807-4241-a792-2a6c79ed4fd0");
         
         // Basic usage - read context
         Context context = client.getContext(contextUuid);
         System.out.println("Context name: " + context.getName());
         
         // With metadata for non-admin users
         client.setIncludeMeta(true);
         Context contextWithMeta = client.getContext(contextUuid);
         
        Parameters:
        uuid - the UUID of the context to retrieve
        Returns:
        the Contexts read from server
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - if the context is not found
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the retrieval
      • getContextFromServer

        protected org.gcube.informationsystem.contexts.reference.entities.Context getContextFromServer​(String uuid)
                                                                                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                                                                                       org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        It reads the context from server by UUID string. The cache used for contexts is bypassed and not updated. Corresponding REST API: GET /access/contexts/{context-uuid}[?includeMeta={true|false}] Operation Behavior:
        • Retrieves the context with the specified UUID from the system
        • Returns the complete context object with all accessible properties
        • Direct UUID-based context retrieval without additional processing.
        Query Parameters includeMeta (configurable via client configuration):
        • Whether to include metadata in the response instance
        • Default value: false (basic information only)
        • Usage: client.setIncludeMeta(true)
        • Values: true (includes metadata with role-based filtering) | false (basic information only)
        • Query parameter: InstancePath.METADATA_POLICY_QUERY_PARAMETER
        • Restriction: IS-Manager, Infrastructure-Manager, and Context-Manager see complete metadata including sensitive information (createdBy, lastUpdatedBy); other users see filtered metadata with sensitive fields obfuscated.
        Input Processing:
        • Accepts a properly formatted UUID object
        • No additional processing or conversion required
        • Direct UUID-based context retrieval.
        Context Access:
        • The context must be accessible to the current user based on authorization level
        • IS-Manager and Infrastructure-Manager can retrieve any context without restrictions
        • Context-Manager can retrieve contexts within their management scope
        • Other users can retrieve contexts they have explicit access to.
        Authorization Requirements:
        • All users must have a valid token and read permissions for the specific context to retrieve it.
        Example Usage:
         ResourceRegistryClient client = ResourceRegistryClientFactory.create();
         
         UUID contextUuid = UUID.fromString("c0f314e7-2807-4241-a792-2a6c79ed4fd0");
         
         // Basic usage - read context
         Context context = client.getContext(contextUuid);
         System.out.println("Context name: " + context.getName());
         
         // With metadata for non-admin users
         client.setIncludeMeta(true);
         Context contextWithMeta = client.getContext(contextUuid);
         
        Parameters:
        uuid - the UUID string of the context to retrieve
        Returns:
        the Context read from server
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - if the context is not found
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the retrieval
      • getContextFromServer

        protected org.gcube.informationsystem.contexts.reference.entities.Context getContextFromServer​(String uuid,
                                                                                                       int depth)
                                                                                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                                                                                       org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        It reads the context from server by UUID string or literal path segment (e.g. ContextPath.CURRENT_PATH_PART), expanding its descendant subtree up to the given depth. The cache used for contexts is bypassed and not updated.
        Parameters:
        uuid - the UUID string, or literal path segment, of the context to retrieve
        depth - 0 for the context alone, a positive N for N levels of descendants, -1 for the full subtree recursively
        Returns:
        the Context read from server
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - if the context is not found
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the retrieval
      • existContext

        public boolean existContext​(String uuid)
                             throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Checks if a context with the specified UUID (as string) exists in the system using internal cache.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        existContext in interface ResourceRegistryClient
        Parameters:
        uuid - the UUID of the context (as string) to check for existence
        Returns:
        true if the context exists and is accessible to the current user, false if not found
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - If there are communication errors with the Resource Registry service
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during the existence check
      • existContext

        public boolean existContext​(UUID uuid)
                             throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Checks if a context with the specified UUID exists in the system using internal cache.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        existContext in interface ResourceRegistryClient
        Parameters:
        uuid - the UUID of the context to check for existence
        Returns:
        true if the context exists and is accessible to the current user, false if not found
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - If the context is not found or not accessible
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during the existence check
      • getContext

        public org.gcube.informationsystem.contexts.reference.entities.Context getContext​(String uuid)
                                                                                   throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                                                                          org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves a specific context by its UUID (as string) using internal cache.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getContext in interface ResourceRegistryClient
        Parameters:
        uuid - the UUID of the context (as string) to retrieve
        Returns:
        the Context object with role-appropriate detail level (from cache)
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - If the context with the specified UUID is not found
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during context retrieval or authorization issues
      • getContext

        public org.gcube.informationsystem.contexts.reference.entities.Context getContext​(UUID uuid)
                                                                                   throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                                                                          org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves a specific context by its UUID using internal cache.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getContext in interface ResourceRegistryClient
        Parameters:
        uuid - the UUID of the context to retrieve
        Returns:
        the Context object with role-appropriate detail level (from cache)
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - If the context with the specified UUID is not found
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during context retrieval or authorization issues
      • getCurrentContext

        public org.gcube.informationsystem.contexts.reference.entities.Context getCurrentContext()
                                                                                          throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                                                                                 org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves the current context associated with the client's authorization token using internal cache.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getCurrentContext in interface ResourceRegistryClient
        Returns:
        the Context object associated with the current authorization token (from cache)
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - If the current context cannot be found or resolved
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during context retrieval or authorization issues
      • getContext

        public org.gcube.informationsystem.contexts.reference.entities.Context getContext​(UUID uuid,
                                                                                          int depth)
                                                                                   throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                                                                          org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves the Context identified by the given UUID directly from the server, expanding its descendant subtree up to the given depth. Bypasses the context cache, since a depth-expanded result is not a stable cacheable shape.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getContext in interface ResourceRegistryClient
        Parameters:
        uuid - the UUID of the context to retrieve
        depth - 0 for the context alone, a positive N for N levels of descendants, -1 for the full subtree recursively
        Returns:
        the Context with its children populated up to the requested depth
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - if no context with the specified UUID exists
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during retrieval
      • getContext

        public org.gcube.informationsystem.contexts.reference.entities.Context getContext​(String uuid,
                                                                                          int depth)
                                                                                   throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                                                                          org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        String-UUID overload of ResourceRegistryClient.getContext(UUID, int).

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getContext in interface ResourceRegistryClient
        Parameters:
        uuid - the UUID (as string) of the context to retrieve
        depth - 0 for the context alone, a positive N for N levels of descendants, -1 for the full subtree recursively
        Returns:
        the Context with its children populated up to the requested depth
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - if no context with the specified UUID exists
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during retrieval
      • getCurrentContext

        public org.gcube.informationsystem.contexts.reference.entities.Context getCurrentContext​(int depth)
                                                                                          throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                                                                                 org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves the context associated with the caller's current authorization token directly from the server, expanding its descendant subtree up to the given depth. Bypasses the context cache, unlike ResourceRegistryClient.getCurrentContext().

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getCurrentContext in interface ResourceRegistryClient
        Parameters:
        depth - 0 for the context alone, a positive N for N levels of descendants, -1 for the full subtree recursively
        Returns:
        the current Context with its children populated up to the requested depth
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - if the current context cannot be resolved
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during retrieval
      • getContextHistory

        public List<org.gcube.informationsystem.model.reference.properties.Event> getContextHistory​(UUID uuid)
                                                                                             throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                                                                                    org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Reads the event history/audit trail of the Context identified by the given UUID. Restricted to administrative roles server-side.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getContextHistory in interface ResourceRegistryClient
        Parameters:
        uuid - the UUID of the context whose history to read
        Returns:
        the history events
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - if no context with the specified UUID exists
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during retrieval
      • getContextHistory

        public List<org.gcube.informationsystem.model.reference.properties.Event> getContextHistory​(String uuid)
                                                                                             throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException,
                                                                                                    org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        String-UUID overload of ResourceRegistryClient.getContextHistory(UUID).

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getContextHistory in interface ResourceRegistryClient
        Parameters:
        uuid - the UUID (as string) of the context whose history to read
        Returns:
        the history events
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException - if no context with the specified UUID exists
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during retrieval
      • existType

        public <ME extends org.gcube.informationsystem.model.reference.ModelElement> boolean existType​(Class<ME> clazz)
                                                                                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Checks if a type definition exists in the Information System using a model element class.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        existType in interface ResourceRegistryClient
        Type Parameters:
        ME - the model element type parameter
        Parameters:
        clazz - the class of the model element type to check for existence
        Returns:
        true if the type corresponding to the class exists in the system, false if not found
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the existence check
      • existType

        public boolean existType​(String typeName)
                          throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Checks if a type definition exists in the Information System using the type name.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        existType in interface ResourceRegistryClient
        Parameters:
        typeName - the name of the type to check for existence (case-sensitive)
        Returns:
        true if the type exists in the system, false if not found
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the existence check
      • existTypeFromServer

        public boolean existTypeFromServer​(String typeName)
                                    throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Checks if a type exists by querying the server directly, bypassing the local knowledge cache. Corresponding REST API: HEAD /access/types/{type-name}[?polymorphic={true|false}&includeMeta={true|false}] Operation Behavior:
        • Verifies the existence of the specified type definition using its name
        • Does not return the type data, only confirms existence
        • Checks accessibility within the current user authorization level
        • Most direct method when type name is already known.
        HTTP Response Codes:
        • 200 OK: Type exists and is accessible
        • 404 Not Found: Type does not exist in the system
        • 403 Forbidden: User lacks authorization to access type information
        • 401 Unauthorized: Invalid or missing authentication credentials.
        Input Processing:
        • Type name must be a valid Information System model type
        • Supports all Information System model types and their subtypes: Entities (Resources and all Resource subtypes, Facets and all Facet subtypes) and Relations (ConsistsOf and all ConsistsOf subtypes, IsRelatedTo and all IsRelatedTo subtypes)
        • Type name is case-sensitive and must match exactly.
        Authorization Requirements:
        • IS-Manager: Can check existence of any type definition
        • Infrastructure-Manager: Can check existence of any type definition
        • All Other Users: Can check existence of any type definition with filtered access to sensitive metadata.
        Example Usage:
         ResourceRegistryClient client = ResourceRegistryClientFactory.create();
         
         // Check if ContactFacet type exists
         boolean contactFacetExists = client.existType("ContactFacet");
         
         // Check if a custom resource type exists
         boolean customResourceExists = client.existType("MyCustomResource");
         
        Parameters:
        typeName - the name of the type to check
        Returns:
        true if the type exists on the server, false otherwise
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the check
      • getTypeFromTypesKnowledge

        public <ERElem extends org.gcube.informationsystem.model.reference.ERElement> List<org.gcube.informationsystem.types.reference.Type> getTypeFromTypesKnowledge​(String typeName,
                                                                                                                                                                       Boolean polymorphic)
                                                                                                                                                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                                                                                                                                                                       org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Gets type information from the local types knowledge cache.
        Type Parameters:
        ERElem - the type parameter extending ERElement
        Parameters:
        typeName - the name of the type to retrieve
        polymorphic - whether to include polymorphic types
        Returns:
        a list of Type objects
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the type schema is not found
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during retrieval
      • getTypeFromTypesKnowledge

        public <ERElem extends org.gcube.informationsystem.model.reference.ERElement> List<org.gcube.informationsystem.types.reference.Type> getTypeFromTypesKnowledge​(String typeName,
                                                                                                                                                                       int level)
                                                                                                                                                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                                                                                                                                                                       org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Gets type information from the local types knowledge cache with level limitation.
        Type Parameters:
        ERElem - the type parameter extending ERElement
        Parameters:
        typeName - the name of the type to retrieve
        level - the depth level for type hierarchy traversal
        Returns:
        a list of Type objects
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the type schema is not found
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during retrieval
      • addChildren

        protected List<org.gcube.informationsystem.types.reference.Type> addChildren​(org.gcube.informationsystem.dag.Node<org.gcube.informationsystem.types.reference.Type> node,
                                                                                     List<org.gcube.informationsystem.types.reference.Type> types,
                                                                                     int currentLevel,
                                                                                     int maxLevel)
        Adds child types in stable breadth-first order, once per type name.
        Parameters:
        node - the current node in the type hierarchy
        types - the list to add types to
        currentLevel - the current depth level
        maxLevel - the maximum depth level to traverse (-1 for unlimited)
        Returns:
        the updated list of types
      • getTypeFromTypesKnowledge

        public <ERElem extends org.gcube.informationsystem.model.reference.ERElement> List<org.gcube.informationsystem.types.reference.Type> getTypeFromTypesKnowledge​(String typeName,
                                                                                                                                                                       Boolean polymorphic,
                                                                                                                                                                       int level)
                                                                                                                                                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                                                                                                                                                                       org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Gets type information from the local types knowledge cache with full configuration.
        Type Parameters:
        ERElem - the type parameter extending ERElement
        Parameters:
        typeName - the name of the type to retrieve
        polymorphic - whether to include polymorphic types
        level - the depth level for type hierarchy traversal (-1 for unlimited)
        Returns:
        a list of Type objects
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the type schema is not found
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during retrieval
      • getType

        public String getType​(String typeName,
                              Boolean polymorphic)
                       throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                              org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Reads a case-sensitive type from the local type snapshot; true includes every descendant, while false or null returns only the requested type.

        Each type occurs once in breadth-first order. A fully cached call reports the CACHE origin through RequestInfo.serverResponses() and has no HTTP response metadata.

        Specified by:
        getType in interface ResourceRegistryClient
        Parameters:
        typeName - the exact type name
        polymorphic - whether to include all descendants; null means false
        Returns:
        a non-null JSON array containing the selected cached type definitions
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the requested type is absent from the snapshot
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if cache initialization, serialization, or retrieval fails
      • getType

        public String getType​(String typeName,
                              int level)
                       throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                              org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Reads a case-sensitive type from the local snapshot with breadth-first depth 0, a positive depth, or -1; values below -1 fall back to root-only depth 0.
        Specified by:
        getType in interface ResourceRegistryClient
        Parameters:
        typeName - the exact type name
        level - 0 for the root, a positive descendant depth, or -1 for all descendants
        Returns:
        a non-null JSON array with each selected cached type exactly once
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the requested type is absent from the snapshot
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if cache initialization, serialization, or retrieval fails
      • getType

        public <ME extends org.gcube.informationsystem.model.reference.ModelElement> List<org.gcube.informationsystem.types.reference.Type> getType​(Class<ME> clazz,
                                                                                                                                                    Boolean polymorphic)
                                                                                                                                             throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                                                                                                                                                    org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Type-safe counterpart of ResourceRegistryClient.getType(String, Boolean) using the class-derived type name.
        Specified by:
        getType in interface ResourceRegistryClient
        Type Parameters:
        ME - the model element type
        Parameters:
        clazz - the class whose exact type name is read
        polymorphic - whether to include all descendants; null means false
        Returns:
        a non-null breadth-first list with each cached type exactly once
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the class-derived type is absent from the snapshot
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if cache initialization or retrieval fails
      • getType

        public <ME extends org.gcube.informationsystem.model.reference.ModelElement> List<org.gcube.informationsystem.types.reference.Type> getType​(Class<ME> clazz,
                                                                                                                                                    int level)
                                                                                                                                             throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                                                                                                                                                    org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Type-safe counterpart of ResourceRegistryClient.getType(String, int) using the class-derived type name.
        Specified by:
        getType in interface ResourceRegistryClient
        Type Parameters:
        ME - the model element type
        Parameters:
        clazz - the class whose exact type name is read
        level - 0 for the root, a positive descendant depth, or -1 for all descendants
        Returns:
        a non-null breadth-first list with each cached type exactly once
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the class-derived type is absent from the snapshot
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if cache initialization or retrieval fails
      • getTypeDagNode

        public org.gcube.informationsystem.dag.Node<org.gcube.informationsystem.types.reference.Type> getTypeDagNode​(String typeName)
                                                                                                              throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                                                                                                                     org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves the type DAG node for a specific type identified by its name. The DAG node contains the type definition and its hierarchical position within the type system.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getTypeDagNode in interface ResourceRegistryClient
        Parameters:
        typeName - the name of the type to retrieve
        Returns:
        the DAG node containing the type and its hierarchical information
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the specified type name does not exist in the schema
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the operation
      • getTypeDagNode

        public <ME extends org.gcube.informationsystem.model.reference.ModelElement> org.gcube.informationsystem.dag.Node<org.gcube.informationsystem.types.reference.Type> getTypeDagNode​(Class<ME> clazz)
                                                                                                                                                                                    throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                                                                                                                                                                                           org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves the type DAG node for a specific type identified by its model element class. The DAG node contains the type definition and its hierarchical position within the type system.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getTypeDagNode in interface ResourceRegistryClient
        Type Parameters:
        ME - the model element type parameter
        Parameters:
        clazz - the class of the model element type to retrieve
        Returns:
        the DAG node containing the type and its hierarchical information
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the type corresponding to the specified class does not exist in the schema
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the operation
      • queryTypes

        public String queryTypes​(String jsonQuery)
                          throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException,
                                 org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Executes a read-only JSON Query-By-Example payload against the global Types collection. The payload must be a non-null JSON object targeting ResourceSchema, FacetSchema, IsRelatedToSchema, ConsistsOfSchema, or PropertySchema. Every authenticated role may invoke the operation and no Context-scoped token is required.

        ResourceRegistryRequestOptions may override limit (default 10, maximum 50), offset (default 0), depth (default -1), and metadataPolicy (default none) for one invocation. Plain name, source, and target filters use depth. An _emit payload returns flat, native-typed aliases and supersedes metadata inclusion. Per-request options take precedence over this client's pagination and metadata defaults.

        The method has no local cache or mutation side effects. It returns [] when no definition matches. Pagination links and parameter/projection warnings are available through RequestInfo.serverResponses().

        Specified by:
        queryTypes in interface ResourceRegistryClient
        Parameters:
        jsonQuery - non-null JSON object describing the Type definitions to search for
        Returns:
        JSON array string containing full Type definitions or flat projection rows; never null
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException - if the payload is malformed, structurally invalid, or targets an unsupported Type category
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if request construction, transport, response processing, or server-side persistence fails
      • getTypeFromServer

        @Deprecated
        public <ME extends org.gcube.informationsystem.model.reference.ModelElement> List<org.gcube.informationsystem.types.reference.Type> getTypeFromServer​(Class<ME> clazz,
                                                                                                                                                              Boolean polymorphic)
                                                                                                                                                       throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                                                                                                                                                              org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Use getTypeFromServer(Class, int) with depth instead.
        Gets type information directly from the server, bypassing the local cache.
        Type Parameters:
        ME - the type parameter extending ModelElement
        Parameters:
        clazz - the class representing the type to retrieve
        polymorphic - whether to include polymorphic types
        Returns:
        a list of Type objects
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the type schema is not found
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during retrieval
      • getTypeFromServer

        public <ME extends org.gcube.informationsystem.model.reference.ModelElement> List<org.gcube.informationsystem.types.reference.Type> getTypeFromServer​(Class<ME> clazz,
                                                                                                                                                              int depth)
                                                                                                                                                       throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                                                                                                                                                              org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Gets type information directly from the server with specific depth, bypassing the local cache.
        Type Parameters:
        ME - the type parameter extending ModelElement
        Parameters:
        clazz - the class representing the type to retrieve
        depth - the depth of subclass expansion
        Returns:
        a list of Type objects
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the type schema is not found
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during retrieval
      • getTypeFromServer

        @Deprecated
        public String getTypeFromServer​(String typeName,
                                        Boolean polymorphic)
                                 throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                                        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Use getTypeFromServer(String, int) with depth instead.
        Reads GET /access/types/{type-name} directly; true maps to depth -1, while false or null maps to depth 0.
        Parameters:
        typeName - the exact, case-sensitive type name
        polymorphic - whether to request every descendant; null means false
        Returns:
        the non-null JSON response array
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the server returns not found
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if authorization, transport, or response processing fails
      • getTypeFromServer

        public String getTypeFromServer​(String typeName,
                                        int depth)
                                 throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                                        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Reads GET /access/types/{type-name} directly with depth and metadataPolicy; invocation metadata policy overrides client configuration. A successful response exposes Content-Location, direct-supertype links, and warnings through RequestInfo.serverResponses(); an unknown exact name maps to 404.
        Parameters:
        typeName - the exact, case-sensitive type name
        depth - 0, a positive descendant depth, or -1
        Returns:
        the non-null JSON response array
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the server returns not found
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if authorization, transport, or response processing fails
      • getInstances

        public <ERElem extends org.gcube.informationsystem.model.reference.ERElement> List<ERElem> getInstances​(Class<ERElem> clazz,
                                                                                                                Boolean polymorphic)
                                                                                                         throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves all instances of the specified type from the Resource Registry.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getInstances in interface ResourceRegistryClient
        Type Parameters:
        ERElem - The specific type of Information System element to retrieve
        Parameters:
        clazz - The class representing the type of instances to retrieve
        polymorphic - Whether to include instances of subtypes (true) or only exact type instances (false). When true, includes all subtypes of the specified type; when false, returns only instances of the exact specified type. This parameter is automatically set in the polymorphic query parameter of the REST API call.
        Returns:
        List of instances of the specified type accessible in the current context
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during instance retrieval or if the type is invalid
      • getInstances

        public String getInstances​(String type,
                                   Boolean polymorphic)
                            throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves all instances of the specified type from the Resource Registry as JSON string.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getInstances in interface ResourceRegistryClient
        Parameters:
        type - The name of the Information System type to retrieve (case-sensitive)
        polymorphic - Whether to include instances of subtypes (true) or only exact type instances (false). When true, includes all subtypes of the specified type; when false, returns only instances of the exact specified type. This parameter is automatically set in the polymorphic query parameter of the REST API call.
        Returns:
        JSON array string containing instances of the specified type accessible in the current context
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during instance retrieval or if the type is invalid
      • existInstance

        public <ERElem extends org.gcube.informationsystem.model.reference.ERElement> boolean existInstance​(Class<ERElem> clazz,
                                                                                                            UUID uuid)
                                                                                                     throws org.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException,
                                                                                                            org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Checks if an Information System element instance exists in the Resource Registry using class and UUID.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        existInstance in interface ResourceRegistryClient
        Type Parameters:
        ERElem - The specific type of Information System element to check
        Parameters:
        clazz - The class representing the type of instance to check
        uuid - The UUID of the instance to check for existence
        Returns:
        true if the instance exists and is accessible in the current context, false if not found
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException - If the instance exists but is not accessible in the current context
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during the existence check
      • existInstance

        public boolean existInstance​(String type,
                                     UUID uuid)
                              throws org.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException,
                                     org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Checks if an Information System element instance exists in the Resource Registry using type name and UUID.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        existInstance in interface ResourceRegistryClient
        Parameters:
        type - The name of the Information System type to check
        uuid - The UUID of the instance to check for existence
        Returns:
        true if the instance exists and is accessible in the current context, false if not found
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException - If the instance exists but is not accessible in the current context
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during the existence check
      • getInstance

        public <ERElem extends org.gcube.informationsystem.model.reference.ERElement> ERElem getInstance​(Class<ERElem> clazz,
                                                                                                         UUID uuid)
                                                                                                  throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException,
                                                                                                         org.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException,
                                                                                                         org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Reads an existing instance from the Resource Registry by its type class and UUID.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getInstance in interface ResourceRegistryClient
        Type Parameters:
        ERElem - The specific type of Entity or Relation to read
        Parameters:
        clazz - The class of the Entity or Relation type to read
        uuid - The unique identifier of the instance to read
        Returns:
        The complete instance from the Resource Registry
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException - If no instance is found with the specified UUID and type
        org.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException - If the instance exists but is not accessible in the current context
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during instance retrieval
      • getInstance

        public String getInstance​(String type,
                                  UUID uuid)
                           throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException,
                                  org.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException,
                                  org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Reads an existing instance from the Resource Registry by its type name and UUID.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getInstance in interface ResourceRegistryClient
        Parameters:
        type - The name of the Information System type to read (case-sensitive)
        uuid - The unique identifier of the instance to read
        Returns:
        JSON string containing the complete instance from the Resource Registry
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException - If no instance is found with the specified UUID and type
        org.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException - If the instance exists but is not accessible in the current context
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during instance retrieval
      • getInstanceContexts

        public <ERElem extends org.gcube.informationsystem.model.reference.ERElement> Map<UUID,​String> getInstanceContexts​(Class<ERElem> clazz,
                                                                                                                                 UUID uuid)
                                                                                                                          throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException,
                                                                                                                                 org.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException,
                                                                                                                                 org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves the list of contexts where a specific Information System element is present in the Resource Registry.

        The element is looked up as by getInstance: it must be present in the token Context, or in one of its descendants when hierarchical mode is enabled. The returned memberships are bounded by the configured membership scope: the token Context subtree by default, every membership with global (restricted to IS-Manager, Infrastructure-Manager and IS-Admin).

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getInstanceContexts in interface ResourceRegistryClient
        Type Parameters:
        ERElem - The type of Information System element (Resource, Facet, ConsistsOf, or IsRelatedTo)
        Parameters:
        clazz - The class of the Information System element whose contexts to retrieve
        uuid - The unique identifier of the element whose contexts to retrieve
        Returns:
        Map containing context UUID to context path mappings where the element is present
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException - If no element is found with the specified class and UUID
        org.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException - If the element exists but is not accessible for context listing
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during context retrieval
      • getInstanceContexts

        public Map<UUID,​String> getInstanceContexts​(String type,
                                                          UUID uuid)
                                                   throws org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException,
                                                          org.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException,
                                                          org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves the list of contexts where a specific Information System element is present in the Resource Registry.

        The element is looked up as by getInstance: it must be present in the token Context, or in one of its descendants when hierarchical mode is enabled. The returned memberships are bounded by the configured membership scope: the token Context subtree by default, every membership with global (restricted to IS-Manager, Infrastructure-Manager and IS-Admin).

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getInstanceContexts in interface ResourceRegistryClient
        Parameters:
        type - The exact type name of the Information System element (e.g., "EService", "ContactFacet")
        uuid - The unique identifier of the element whose contexts to retrieve
        Returns:
        Map containing context UUID to context path mappings where the element is present
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException - If no element is found with the specified type and UUID
        org.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException - If the element exists but is not accessible for context listing
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during context retrieval
      • getAllQueryTemplates

        public List<org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate> getAllQueryTemplates()
                                                                                                                  throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Retrieves one configured page of global Query Templates. Pagination and metadata settings are forwarded in contract order. The token Context is not a visibility boundary, while metadata identity fields are redacted for non-privileged callers.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        getAllQueryTemplates in interface ResourceRegistryClient
        Returns:
        the configured page of query templates
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during query template retrieval
      • existQueryTemplate

        public boolean existQueryTemplate​(org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate queryTemplate)
                                   throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException,
                                          org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Checks if a query template exists in the Resource Registry.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        existQueryTemplate in interface ResourceRegistryClient
        Parameters:
        queryTemplate - The query template to check for existence (must have a valid name)
        Returns:
        true if the query template exists and is accessible, false if not found
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during the existence check
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException
      • existQueryTemplate

        public boolean existQueryTemplate​(String queryTemplateName)
                                   throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException,
                                          org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Checks if a query template exists in the Resource Registry using template name.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        existQueryTemplate in interface ResourceRegistryClient
        Parameters:
        queryTemplateName - The name of the query template to check for existence
        Returns:
        true if the query template exists and is accessible, false if not found
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during the existence check
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException
      • readQueryTemplate

        public org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate readQueryTemplate​(org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate queryTemplate)
                                                                                                         throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException,
                                                                                                                org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Reads the global Query Template whose exact name is carried by the supplied object. Metadata inclusion follows the configured metadataPolicy; identity fields are redacted by the server for non-global roles.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        readQueryTemplate in interface ResourceRegistryClient
        Parameters:
        queryTemplate - the object carrying the Query Template name
        Returns:
        the matching Query Template
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException - if the exact name does not exist
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if retrieval fails
      • readQueryTemplate

        public org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate readQueryTemplate​(String queryTemplateName)
                                                                                                         throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException,
                                                                                                                org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Reads a global Query Template using its exact, case-sensitive name. Metadata inclusion follows the configured policy; identity fields are redacted by the server for non-global roles.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        readQueryTemplate in interface ResourceRegistryClient
        Parameters:
        queryTemplateName - the exact Query Template name
        Returns:
        the matching Query Template
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException - if the exact name does not exist
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if retrieval fails
      • readQueryTemplateAsString

        public String readQueryTemplateAsString​(String queryTemplateName)
                                         throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException,
                                                org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Reads a global Query Template as JSON. The exact name and configured metadata policy are forwarded unchanged.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        readQueryTemplateAsString in interface ResourceRegistryClient
        Parameters:
        queryTemplateName - the exact Query Template name
        Returns:
        the matching Query Template JSON representation
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException - if the exact name does not exist
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if retrieval fails
      • runQueryTemplate

        public String runQueryTemplate​(String name)
                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException,
                                       org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Executes a query template and returns results as JSON string (deprecated method).

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        runQueryTemplate in interface ResourceRegistryClient
        Parameters:
        name - The name of the query template to execute
        Returns:
        JSON array string containing query results
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException - If the query template with the specified name does not exist
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during query template execution
      • runQueryTemplate

        public String runQueryTemplate​(org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate queryTemplate)
                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException,
                                       org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Executes a query template using template object and returns results as JSON string.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        runQueryTemplate in interface ResourceRegistryClient
        Parameters:
        queryTemplate - The query template to execute (name is extracted from this object)
        Returns:
        JSON array string containing query results
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException - If the query template with the specified name does not exist
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during query template execution
      • runQueryTemplate

        public String runQueryTemplate​(String name,
                                       String params)
                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException,
                                       org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Executes a query template with string parameters and returns results as JSON string.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        runQueryTemplate in interface ResourceRegistryClient
        Parameters:
        name - The name of the query template to execute
        params - JSON string containing parameter values for template substitution
        Returns:
        JSON array string containing query results
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException - If the query template with the specified name does not exist
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during query template execution
      • runQueryTemplate

        public String runQueryTemplate​(String name,
                                       org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)
                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException,
                                       org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Executes a query template with JsonNode parameters and returns results as JSON string.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        runQueryTemplate in interface ResourceRegistryClient
        Parameters:
        name - The name of the query template to execute
        jsonNode - JsonNode containing parameter values for template substitution
        Returns:
        JSON array string containing query results
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException - If the query template with the specified name does not exist
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during query template execution
      • runQueryTemplate

        public String runQueryTemplate​(org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate queryTemplate,
                                       org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)
                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException,
                                       org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Executes a query template using template object with JsonNode parameters and returns results as JSON string.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        runQueryTemplate in interface ResourceRegistryClient
        Parameters:
        queryTemplate - The query template to execute (name is extracted from this object)
        jsonNode - JsonNode containing parameter values for template substitution
        Returns:
        JSON array string containing query results
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.templates.QueryTemplateNotFoundException - If the query template with the specified name does not exist
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during query template execution
      • queryContexts

        public String queryContexts​(String jsonQuery)
                             throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException,
                                    org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Executes a JSON Query-By-Example payload against the Contexts collection.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        queryContexts in interface ResourceRegistryClient
        Parameters:
        jsonQuery - JSON object describing the Context structure to search for
        Returns:
        JSON array string containing the matching Contexts
        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
      • queryQueryTemplates

        public String queryQueryTemplates​(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 payload against the global Query Template definitions, forwarding the configured limit, offset, and metadata policy. This searches templates themselves; use ResourceRegistryClient.runQueryTemplate(String, String) to run one.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        queryQueryTemplates in interface ResourceRegistryClient
        Parameters:
        jsonQuery - JSON object describing the Query Template structure to search for
        Returns:
        JSON array string containing the matching Query Template 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
      • jsonQuery

        public String jsonQuery​(String query)
                         throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException,
                                org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Executes a JSON Query-By-Example payload against the Instances collection.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        jsonQuery in interface ResourceRegistryClient
        Parameters:
        query - JSON string describing the structure to search for
        Returns:
        JSON array string containing the matching instances
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException - If the query structure is invalid or contains syntax errors
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during query execution
      • jsonQuery

        public <E extends org.gcube.informationsystem.model.reference.entities.Entity> List<E> jsonQuery​(org.gcube.com.fasterxml.jackson.databind.JsonNode jsonNode)
                                                                                                  throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException,
                                                                                                         org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Typed overload of ResourceRegistryClient.jsonQuery(String), deserializing the JSON query result into strongly-typed Entity instances.

        Invocation-specific options and immutable response metadata are available through RequestInfo.serverResponses().

        Specified by:
        jsonQuery in interface ResourceRegistryClient
        Type Parameters:
        E - the specific Entity type expected in results
        Parameters:
        jsonNode - JsonNode representing the query structure
        Returns:
        List of Entity instances matching the query criteria
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException - If the query structure is invalid or contains syntax errors
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - If an error occurs during query execution
      • getTypeTreeNode

        @Deprecated
        public <ME extends org.gcube.informationsystem.model.reference.ModelElement> org.gcube.informationsystem.dag.Node<org.gcube.informationsystem.types.reference.Type> getTypeTreeNode​(Class<ME> clazz)
                                                                                                                                                                                     throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                                                                                                                                                                                            org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Retrieves the type node for the given model element class.
        Specified by:
        getTypeTreeNode in interface ResourceRegistryClient
        Type Parameters:
        ME - the model element type parameter
        Parameters:
        clazz - the class of the model element type to retrieve
        Returns:
        the DAG node containing the type and its hierarchical information
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the type corresponding to the specified class does not exist in the schema
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the operation
      • getTypeTreeNode

        @Deprecated
        public org.gcube.informationsystem.dag.Node<org.gcube.informationsystem.types.reference.Type> getTypeTreeNode​(String typeName)
                                                                                                               throws org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException,
                                                                                                                      org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Retrieves the type node for the given type name.
        Specified by:
        getTypeTreeNode in interface ResourceRegistryClient
        Parameters:
        typeName - the name of the type to retrieve
        Returns:
        the DAG node containing the type and its hierarchical information
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException - if the specified type name does not exist in the schema
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - if an error occurs during the operation
      • rawQuery

        @Deprecated
        public String rawQuery​(String query)
                        throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException,
                               org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Not available: the raw query endpoint of the Resource Registry is an administrative operation (QUERY /admin/raw-query) that this client does not expose.
        Specified by:
        rawQuery in interface ResourceRegistryClient
        Parameters:
        query - the raw query
        Returns:
        never returns
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException - never thrown
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - never thrown
      • rawQuery

        @Deprecated
        public String rawQuery​(String query,
                               boolean raw)
                        throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException,
                               org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Not available: the raw query endpoint of the Resource Registry is an administrative operation (QUERY /admin/raw-query) that this client does not expose.
        Specified by:
        rawQuery in interface ResourceRegistryClient
        Parameters:
        query - the raw query
        raw - whether the raw result is requested
        Returns:
        never returns
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException - never thrown
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - never thrown
      • getResourcesFromReferenceFacet

        @Deprecated
        public <R extends org.gcube.informationsystem.model.reference.entities.Resource,​C extends org.gcube.informationsystem.model.reference.relations.ConsistsOf<?,​?>,​F extends org.gcube.informationsystem.model.reference.entities.Facet> List<R> getResourcesFromReferenceFacet​(Class<R> resourceClass,
                                                                                                                                                                                                                                                                                                       Class<C> consistsOfClass,
                                                                                                                                                                                                                                                                                                       F referenceFacet,
                                                                                                                                                                                                                                                                                                       boolean polymorphic)
                                                                                                                                                                                                                                                                                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Not available: the prepared query endpoint (GET /access/query/{resource-type}/{relation-type}/{reference-type}) no longer exists in the Resource Registry and has no replacement.
        Specified by:
        getResourcesFromReferenceFacet in interface ResourceRegistryClient
        Type Parameters:
        R - the resource type
        C - the ConsistsOf type
        F - the facet type
        Parameters:
        resourceClass - the resource class
        consistsOfClass - the ConsistsOf class
        referenceFacet - the reference facet
        polymorphic - whether subtypes are included
        Returns:
        never returns
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - never thrown
      • getResourcesFromReferenceFacet

        @Deprecated
        public <R extends org.gcube.informationsystem.model.reference.entities.Resource,​C extends org.gcube.informationsystem.model.reference.relations.ConsistsOf<?,​?>,​F extends org.gcube.informationsystem.model.reference.entities.Facet> List<R> getResourcesFromReferenceFacet​(Class<R> resourceClass,
                                                                                                                                                                                                                                                                                                       Class<C> consistsOfClass,
                                                                                                                                                                                                                                                                                                       Class<F> facetClass,
                                                                                                                                                                                                                                                                                                       UUID referenceFacetUUID,
                                                                                                                                                                                                                                                                                                       boolean polymorphic)
                                                                                                                                                                                                                                                                                                throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Not available: the prepared query endpoint (GET /access/query/{resource-type}/{relation-type}/{reference-type}) no longer exists in the Resource Registry and has no replacement.
        Specified by:
        getResourcesFromReferenceFacet in interface ResourceRegistryClient
        Type Parameters:
        R - the resource type
        C - the ConsistsOf type
        F - the facet type
        Parameters:
        resourceClass - the resource class
        consistsOfClass - the ConsistsOf class
        facetClass - the facet class
        referenceFacetUUID - the UUID of the reference facet
        polymorphic - whether subtypes are included
        Returns:
        never returns
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - never thrown
      • getResourcesFromReferenceFacet

        @Deprecated
        public String getResourcesFromReferenceFacet​(String resourceType,
                                                     String consistsOfType,
                                                     String facetType,
                                                     UUID referenceFacetUUID,
                                                     boolean polymorphic)
                                              throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Not available: the prepared query endpoint (GET /access/query/{resource-type}/{relation-type}/{reference-type}) no longer exists in the Resource Registry and has no replacement.
        Specified by:
        getResourcesFromReferenceFacet in interface ResourceRegistryClient
        Parameters:
        resourceType - the resource type name
        consistsOfType - the ConsistsOf type name
        facetType - the facet type name
        referenceFacetUUID - the UUID of the reference facet
        polymorphic - whether subtypes are included
        Returns:
        never returns
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - never thrown
      • getFilteredResources

        @Deprecated
        public <R extends org.gcube.informationsystem.model.reference.entities.Resource,​C extends org.gcube.informationsystem.model.reference.relations.ConsistsOf<?,​?>,​F extends org.gcube.informationsystem.model.reference.entities.Facet> List<R> getFilteredResources​(Class<R> resourceClass,
                                                                                                                                                                                                                                                                                             Class<C> consistsOfClass,
                                                                                                                                                                                                                                                                                             Class<F> facetClass,
                                                                                                                                                                                                                                                                                             boolean polymorphic,
                                                                                                                                                                                                                                                                                             Map<String,​String> facetConstraint)
                                                                                                                                                                                                                                                                                      throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Not available: the prepared query endpoint (GET /access/query/{resource-type}/{relation-type}/{reference-type}) no longer exists in the Resource Registry and has no replacement.
        Specified by:
        getFilteredResources in interface ResourceRegistryClient
        Type Parameters:
        R - the resource type
        C - the ConsistsOf type
        F - the facet type
        Parameters:
        resourceClass - the resource class
        consistsOfClass - the ConsistsOf class
        facetClass - the facet class
        polymorphic - whether subtypes are included
        facetConstraint - the constraints on the facet properties
        Returns:
        never returns
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - never thrown
      • getFilteredResources

        @Deprecated
        public String getFilteredResources​(String resourceType,
                                           String consistsOfType,
                                           String facetType,
                                           boolean polymorphic,
                                           Map<String,​String> facetConstraint)
                                    throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Not available: the prepared query endpoint (GET /access/query/{resource-type}/{relation-type}/{reference-type}) no longer exists in the Resource Registry and has no replacement.
        Specified by:
        getFilteredResources in interface ResourceRegistryClient
        Parameters:
        resourceType - the resource type name
        consistsOfType - the ConsistsOf type name
        facetType - the facet type name
        polymorphic - whether subtypes are included
        facetConstraint - the constraints on the facet properties
        Returns:
        never returns
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - never thrown
      • getRelatedResourcesFromReferenceResource

        @Deprecated
        public <R extends org.gcube.informationsystem.model.reference.entities.Resource,​I extends org.gcube.informationsystem.model.reference.relations.IsRelatedTo<?,​?>,​RR extends org.gcube.informationsystem.model.reference.entities.Resource> List<R> getRelatedResourcesFromReferenceResource​(Class<R> resourceClass,
                                                                                                                                                                                                                                                                                                                      Class<I> isRelatedToClass,
                                                                                                                                                                                                                                                                                                                      RR referenceResource,
                                                                                                                                                                                                                                                                                                                      org.gcube.informationsystem.base.reference.Direction direction,
                                                                                                                                                                                                                                                                                                                      boolean polymorphic)
                                                                                                                                                                                                                                                                                                               throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Not available: the prepared query endpoint (GET /access/query/{resource-type}/{relation-type}/{reference-type}) no longer exists in the Resource Registry and has no replacement.
        Specified by:
        getRelatedResourcesFromReferenceResource in interface ResourceRegistryClient
        Type Parameters:
        R - the resource type
        I - the IsRelatedTo type
        RR - the reference resource type
        Parameters:
        resourceClass - the resource class
        isRelatedToClass - the IsRelatedTo class
        referenceResource - the reference resource
        direction - the direction of the relation
        polymorphic - whether subtypes are included
        Returns:
        never returns
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - never thrown
      • getRelatedResourcesFromReferenceResource

        @Deprecated
        public <R extends org.gcube.informationsystem.model.reference.entities.Resource,​I extends org.gcube.informationsystem.model.reference.relations.IsRelatedTo<?,​?>,​RR extends org.gcube.informationsystem.model.reference.entities.Resource> List<R> getRelatedResourcesFromReferenceResource​(Class<R> resourceClass,
                                                                                                                                                                                                                                                                                                                      Class<I> isRelatedToClass,
                                                                                                                                                                                                                                                                                                                      Class<RR> referenceResourceClass,
                                                                                                                                                                                                                                                                                                                      UUID referenceResourceUUID,
                                                                                                                                                                                                                                                                                                                      org.gcube.informationsystem.base.reference.Direction direction,
                                                                                                                                                                                                                                                                                                                      boolean polymorphic)
                                                                                                                                                                                                                                                                                                               throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Not available: the prepared query endpoint (GET /access/query/{resource-type}/{relation-type}/{reference-type}) no longer exists in the Resource Registry and has no replacement.
        Specified by:
        getRelatedResourcesFromReferenceResource in interface ResourceRegistryClient
        Type Parameters:
        R - the resource type
        I - the IsRelatedTo type
        RR - the reference resource type
        Parameters:
        resourceClass - the resource class
        isRelatedToClass - the IsRelatedTo class
        referenceResourceClass - the reference resource class
        referenceResourceUUID - the UUID of the reference resource
        direction - the direction of the relation
        polymorphic - whether subtypes are included
        Returns:
        never returns
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - never thrown
      • getRelatedResourcesFromReferenceResource

        @Deprecated
        public String getRelatedResourcesFromReferenceResource​(String resourceType,
                                                               String isRelatedToType,
                                                               String referenceResourceType,
                                                               UUID referenceResourceUUID,
                                                               org.gcube.informationsystem.base.reference.Direction direction,
                                                               boolean polymorphic)
                                                        throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Not available: the prepared query endpoint (GET /access/query/{resource-type}/{relation-type}/{reference-type}) no longer exists in the Resource Registry and has no replacement.
        Specified by:
        getRelatedResourcesFromReferenceResource in interface ResourceRegistryClient
        Parameters:
        resourceType - the resource type name
        isRelatedToType - the IsRelatedTo type name
        referenceResourceType - the reference resource type name
        referenceResourceUUID - the UUID of the reference resource
        direction - the direction of the relation
        polymorphic - whether subtypes are included
        Returns:
        never returns
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - never thrown
      • getRelatedResources

        @Deprecated
        public <R extends org.gcube.informationsystem.model.reference.entities.Resource,​I extends org.gcube.informationsystem.model.reference.relations.IsRelatedTo<?,​?>,​RR extends org.gcube.informationsystem.model.reference.entities.Resource> List<R> getRelatedResources​(Class<R> resourceClass,
                                                                                                                                                                                                                                                                                                 Class<I> isRelatedToClass,
                                                                                                                                                                                                                                                                                                 Class<RR> referenceResourceClass,
                                                                                                                                                                                                                                                                                                 org.gcube.informationsystem.base.reference.Direction direction,
                                                                                                                                                                                                                                                                                                 boolean polymorphic)
                                                                                                                                                                                                                                                                                          throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Not available: the prepared query endpoint (GET /access/query/{resource-type}/{relation-type}/{reference-type}) no longer exists in the Resource Registry and has no replacement.
        Specified by:
        getRelatedResources in interface ResourceRegistryClient
        Type Parameters:
        R - the resource type
        I - the IsRelatedTo type
        RR - the reference resource type
        Parameters:
        resourceClass - the resource class
        isRelatedToClass - the IsRelatedTo class
        referenceResourceClass - the reference resource class
        direction - the direction of the relation
        polymorphic - whether subtypes are included
        Returns:
        never returns
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - never thrown
      • getRelatedResources

        @Deprecated
        public String getRelatedResources​(String resourceType,
                                          String isRelatedToType,
                                          String referenceResourceType,
                                          org.gcube.informationsystem.base.reference.Direction direction,
                                          boolean polymorphic)
                                   throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException
        Deprecated.
        Not available: the prepared query endpoint (GET /access/query/{resource-type}/{relation-type}/{reference-type}) no longer exists in the Resource Registry and has no replacement.
        Specified by:
        getRelatedResources in interface ResourceRegistryClient
        Parameters:
        resourceType - the resource type name
        isRelatedToType - the IsRelatedTo type name
        referenceResourceType - the reference resource type name
        direction - the direction of the relation
        polymorphic - whether subtypes are included
        Returns:
        never returns
        Throws:
        org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException - never thrown