Class ResourceRegistryClientImpl
- All Implemented Interfaces:
org.gcube.informationsystem.resourceregistry.api.request.RequestInfo,ResourceRegistryClient
ResourceRegistryClient implementation. Talks to the Resource Registry
service over HTTP via GXHTTPStringRequest, translating each interface method into
the corresponding /access/... request, applying the client-side query parameter
configuration (metadata policy, hierarchical mode, include-contexts, 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
FieldsModifier and TypeFieldDescriptionprotected final StringThe base address of the Resource Registry serviceprotected org.gcube.informationsystem.resourceregistry.api.contexts.ContextCacheCache for context informationprotected org.gcube.informationsystem.resourceregistry.api.contexts.ContextCacheRenewalContext cache renewal strategy that reads all contexts from the serverAdditional HTTP headers to be included in requestsprotected org.gcube.informationsystem.types.knowledge.TypesKnowledgeKnowledge base for type informationFields inherited from class org.gcube.informationsystem.resourceregistry.api.request.BaseRequestInfo
allMeta, hierarchicalMode, includeContexts, includeMeta, limit, offsetFields inherited from interface org.gcube.informationsystem.resourceregistry.api.request.RequestInfo
DEFAULT_LIMIT, DEFAULT_OFFSET, UNBOUNDED_LIMIT -
Constructor Summary
ConstructorsConstructorDescriptionResourceRegistryClientImpl(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
Modifier and TypeMethodDescriptionprotected 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.voidAdds a custom HTTP header to be included in requests.voidAdds a custom HTTP header to be included in requests.booleanexistContext(String uuid) Checks if a context with the specified UUID (as string) exists in the system using internal cache.booleanexistContext(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>
booleanexistInstance(Class<ERElem> clazz, UUID uuid) Checks if an Information System element instance exists in the Resource Registry using class and UUID.booleanexistInstance(String type, UUID uuid) Checks if an Information System element instance exists in the Resource Registry using type name and UUID.booleanexistQueryTemplate(String queryTemplateName) Checks if a query template exists in the Resource Registry using template name.booleanexistQueryTemplate(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>
booleanChecks if a type definition exists in the Information System using a model element class.booleanChecks if a type definition exists in the Information System using the type name.booleanexistTypeFromServer(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>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>Retrieves all available contexts using internal cache.List<org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate>Retrieves one configured page of global Query Templates.org.gcube.informationsystem.contexts.reference.entities.ContextgetContext(String uuid) Retrieves a specific context by its UUID (as string) using internal cache.org.gcube.informationsystem.contexts.reference.entities.ContextgetContext(String uuid, int depth) String-UUID overload ofResourceRegistryClient.getContext(UUID, int).org.gcube.informationsystem.contexts.reference.entities.ContextgetContext(UUID uuid) Retrieves a specific context by its UUID using internal cache.org.gcube.informationsystem.contexts.reference.entities.ContextgetContext(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.ContextCacheGets the context cache used for context-related operations.protected org.gcube.informationsystem.contexts.reference.entities.ContextgetContextFromServer(String uuid) It reads the context from server by UUID string.protected org.gcube.informationsystem.contexts.reference.entities.ContextgetContextFromServer(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.ContextgetContextFromServer(UUID uuid) It reads the context from server by UUID.List<org.gcube.informationsystem.model.reference.properties.Event>getContextHistory(String uuid) String-UUID overload ofResourceRegistryClient.getContextHistory(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.ContextRetrieves the current context associated with the client's authorization token using internal cache.org.gcube.informationsystem.contexts.reference.entities.ContextgetCurrentContext(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.protected org.gcube.common.gxhttp.request.GXHTTPStringRequestCreates and configures a new HTTP request with authorization headers and custom headers.<ERElem extends org.gcube.informationsystem.model.reference.ERElement>
ERElemgetInstance(Class<ERElem> clazz, UUID uuid) Reads an existing instance from the Resource Registry by its type class and UUID.getInstance(String type, UUID uuid) Reads an existing instance from the Resource Registry by its type name and UUID.getInstanceContexts(Class<ERElem> clazz, UUID uuid) Retrieves the list of contexts where a specific Information System element is present in the Resource Registry.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.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> Retrieves the complete model knowledge containing type definitions and their information.<ME extends org.gcube.informationsystem.model.reference.ModelElement>
List<org.gcube.informationsystem.types.reference.Type>Type-safe counterpart ofResourceRegistryClient.getType(String, int)using the class-derived type name.<ME extends org.gcube.informationsystem.model.reference.ModelElement>
List<org.gcube.informationsystem.types.reference.Type>Type-safe counterpart ofResourceRegistryClient.getType(String, Boolean)using the class-derived type name.Reads a case-sensitive type from the local snapshot with breadth-first depth0, a positive depth, or-1; values below-1fall back to root-only depth0.Reads a case-sensitive type from the local type snapshot;trueincludes every descendant, whilefalseornullreturns 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.getTypeFromServer(String typeName, int depth) ReadsGET /access/types/{type-name}directly withdepthandmetadataPolicy; invocation metadata policy overrides client configuration.getTypeFromServer(String typeName, Boolean polymorphic) Deprecated.UsegetTypeFromServer(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.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 ofResourceRegistryClient.jsonQuery(String), deserializing the JSON query result into strongly-typedEntityinstances.queryContexts(String jsonQuery) Executes a JSON Query-By-Example payload against the Contexts collection.queryQueryTemplates(String jsonQuery) Executes a paginated JSON Query-By-Example payload against the global Query Template definitions, forwarding the configuredlimit,offset, and metadata policy.queryTypes(String jsonQuery) Executes a read-only JSON Query-By-Example payload against the global Types collection.org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplatereadQueryTemplate(String queryTemplateName) Reads a global Query Template using its exact, case-sensitive name.org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplatereadQueryTemplate(org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate queryTemplate) Reads the global Query Template whose exact name is carried by the supplied object.readQueryTemplateAsString(String queryTemplateName) Reads a global Query Template as JSON.voidForces a renewal of the cached model knowledge by fetching the latest version from the Resource Registry.runQueryTemplate(String name) Executes a query template and returns results as JSON string (deprecated method).runQueryTemplate(String name, String params) Executes a query template with string parameters and returns results as JSON 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.runQueryTemplate(org.gcube.informationsystem.queries.templates.reference.entities.QueryTemplate queryTemplate) Executes a query template using template object and returns results as JSON 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, getLimit, getOffset, includeContexts, includeMeta, isHierarchicalMode, setAllMeta, setHierarchicalMode, setIncludeContexts, setIncludeMeta, setLimit, setOffsetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gcube.informationsystem.resourceregistry.api.request.RequestInfo
allMeta, getLimit, getOffset, includeContexts, includeMeta, isHierarchicalMode, serverResponses, setAllMeta, setHierarchicalMode, setIncludeContexts, setIncludeMeta, setLimit, setOffsetMethods inherited from interface org.gcube.informationsystem.resourceregistry.client.ResourceRegistryClient
list, list, query, query
-
Field Details
-
address
The base address of the Resource Registry service -
headers
Additional HTTP headers to be included in requests -
contextCache
protected org.gcube.informationsystem.resourceregistry.api.contexts.ContextCache contextCacheCache for context information -
typesKnowledge
protected org.gcube.informationsystem.types.knowledge.TypesKnowledge typesKnowledgeKnowledge base for type information -
contextCacheRenewal
protected org.gcube.informationsystem.resourceregistry.api.contexts.ContextCacheRenewal contextCacheRenewalContext cache renewal strategy that reads all contexts from the server
-
-
Constructor Details
-
ResourceRegistryClientImpl
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 servicesharedContextCache- true to use shared context cache, false for dedicated cachesharedModelKnowledge- true to use shared model knowledge, false for dedicated knowledge
-
-
Method Details
-
addHeader
Adds a custom HTTP header to be included in requests.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Specified by:
addHeaderin interfaceResourceRegistryClient- Parameters:
name- Header namevalue- Header value
-
addHeader
Adds a custom HTTP header to be included in requests.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Specified by:
addHeaderin interfaceResourceRegistryClient- Parameters:
name- Header namevalue- boolean value
-
getGXHTTPStringRequest
protected org.gcube.common.gxhttp.request.GXHTTPStringRequest getGXHTTPStringRequest()Creates and configures a new HTTP request with authorization headers and custom headers.- Returns:
- A configured GXHTTPStringRequest 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:
getContextCachein interfaceResourceRegistryClient- Returns:
- The context cache instance
-
getAllContexts
public List<org.gcube.informationsystem.contexts.reference.entities.Context> getAllContexts() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionRetrieves all available contexts using internal cache.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Specified by:
getAllContextsin interfaceResourceRegistryClient- 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.ResourceRegistryExceptionRetrieves 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- All users must have a valid token and basic read permissions to list contexts they have access to.
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 responseoffset- the starting position for paginationlimit- 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:
getModelKnowledgein interfaceResourceRegistryClient- 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:
renewModelKnowledgein interfaceResourceRegistryClient
-
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.
- 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.
- Accepts a properly formatted UUID object
- No additional processing or conversion required
- Direct UUID-based context retrieval.
- 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.
- All users must have a valid token and read permissions for the specific context to retrieve it.
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 foundorg.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.
- 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.
- Accepts a properly formatted UUID object
- No additional processing or conversion required
- Direct UUID-based context retrieval.
- 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.
- All users must have a valid token and read permissions for the specific context to retrieve it.
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 foundorg.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 retrievedepth-0for the context alone, a positiveNforNlevels of descendants,-1for the full subtree recursively- Returns:
- the Context read from server
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException- if the context is not foundorg.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:
existContextin interfaceResourceRegistryClient- 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 serviceorg.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:
existContextin interfaceResourceRegistryClient- 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 accessibleorg.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:
getContextin interfaceResourceRegistryClient- 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 foundorg.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:
getContextin interfaceResourceRegistryClient- 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 foundorg.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.ResourceRegistryExceptionRetrieves 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:
getCurrentContextin interfaceResourceRegistryClient- 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 resolvedorg.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:
getContextin interfaceResourceRegistryClient- Parameters:
uuid- the UUID of the context to retrievedepth-0for the context alone, a positiveNforNlevels of descendants,-1for the full subtree recursively- Returns:
- the Context with its
childrenpopulated up to the requested depth - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException- if no context with the specified UUID existsorg.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 ofResourceRegistryClient.getContext(UUID, int).Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Specified by:
getContextin interfaceResourceRegistryClient- Parameters:
uuid- the UUID (as string) of the context to retrievedepth-0for the context alone, a positiveNforNlevels of descendants,-1for the full subtree recursively- Returns:
- the Context with its
childrenpopulated up to the requested depth - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException- if no context with the specified UUID existsorg.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, unlikeResourceRegistryClient.getCurrentContext().Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Specified by:
getCurrentContextin interfaceResourceRegistryClient- Parameters:
depth-0for the context alone, a positiveNforNlevels of descendants,-1for the full subtree recursively- Returns:
- the current Context with its
childrenpopulated up to the requested depth - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException- if the current context cannot be resolvedorg.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:
getContextHistoryin interfaceResourceRegistryClient- 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 existsorg.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 ofResourceRegistryClient.getContextHistory(UUID).Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Specified by:
getContextHistoryin interfaceResourceRegistryClient- 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 existsorg.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:
existTypein interfaceResourceRegistryClient- 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:
existTypein interfaceResourceRegistryClient- 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.
- 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.
- 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.
- 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.
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 retrievepolymorphic- 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 foundorg.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 retrievelevel- 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 foundorg.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 hierarchytypes- the list to add types tocurrentLevel- the current depth levelmaxLevel- 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 retrievepolymorphic- whether to include polymorphic typeslevel- 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 foundorg.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;trueincludes every descendant, whilefalseornullreturns only the requested type.Each type occurs once in breadth-first order. A fully cached call reports the
CACHEorigin throughRequestInfo.serverResponses()and has no HTTP response metadata.- Specified by:
getTypein interfaceResourceRegistryClient- Parameters:
typeName- the exact type namepolymorphic- whether to include all descendants;nullmeansfalse- 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 snapshotorg.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 depth0, a positive depth, or-1; values below-1fall back to root-only depth0.- Specified by:
getTypein interfaceResourceRegistryClient- Parameters:
typeName- the exact type namelevel-0for the root, a positive descendant depth, or-1for 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 snapshotorg.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 ofResourceRegistryClient.getType(String, Boolean)using the class-derived type name.- Specified by:
getTypein interfaceResourceRegistryClient- Type Parameters:
ME- the model element type- Parameters:
clazz- the class whose exact type name is readpolymorphic- whether to include all descendants;nullmeansfalse- 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 snapshotorg.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 ofResourceRegistryClient.getType(String, int)using the class-derived type name.- Specified by:
getTypein interfaceResourceRegistryClient- Type Parameters:
ME- the model element type- Parameters:
clazz- the class whose exact type name is readlevel-0for the root, a positive descendant depth, or-1for 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 snapshotorg.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:
getTypeDagNodein interfaceResourceRegistryClient- 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 schemaorg.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:
getTypeDagNodein interfaceResourceRegistryClient- 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 schemaorg.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 targetingResourceSchema,FacetSchema,IsRelatedToSchema,ConsistsOfSchema, orPropertySchema. Every authenticated role may invoke the operation and no Context-scoped token is required.ResourceRegistryRequestOptionsmay overridelimit(default 10, maximum 50),offset(default 0),depth(default -1), andmetadataPolicy(default none) for one invocation. Plainname,source, andtargetfilters usedepth. An_emitpayload 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 throughRequestInfo.serverResponses().- Specified by:
queryTypesin interfaceResourceRegistryClient- 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 categoryorg.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.UsegetTypeFromServer(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 retrievepolymorphic- 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 foundorg.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 retrievedepth- 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 foundorg.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.UsegetTypeFromServer(String, int)with depth instead.ReadsGET /access/types/{type-name}directly;truemaps to depth-1, whilefalseornullmaps to depth0.- Parameters:
typeName- the exact, case-sensitive type namepolymorphic- whether to request every descendant;nullmeansfalse- Returns:
- the non-null JSON response array
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.types.SchemaNotFoundException- if the server returns not foundorg.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 ReadsGET /access/types/{type-name}directly withdepthandmetadataPolicy; invocation metadata policy overrides client configuration. A successful response exposesContent-Location, direct-supertype links, and warnings throughRequestInfo.serverResponses(); an unknown exact name maps to404.- Parameters:
typeName- the exact, case-sensitive type namedepth-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 foundorg.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:
getInstancesin interfaceResourceRegistryClient- Type Parameters:
ERElem- The specific type of Information System element to retrieve- Parameters:
clazz- The class representing the type of instances to retrievepolymorphic- 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 thepolymorphicquery 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:
getInstancesin interfaceResourceRegistryClient- 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 thepolymorphicquery 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:
existInstancein interfaceResourceRegistryClient- Type Parameters:
ERElem- The specific type of Information System element to check- Parameters:
clazz- The class representing the type of instance to checkuuid- 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 contextorg.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:
existInstancein interfaceResourceRegistryClient- Parameters:
type- The name of the Information System type to checkuuid- 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 contextorg.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:
getInstancein interfaceResourceRegistryClient- Type Parameters:
ERElem- The specific type of Entity or Relation to read- Parameters:
clazz- The class of the Entity or Relation type to readuuid- 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 typeorg.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException- If the instance exists but is not accessible in the current contextorg.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:
getInstancein interfaceResourceRegistryClient- 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 typeorg.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException- If the instance exists but is not accessible in the current contextorg.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.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Specified by:
getInstanceContextsin interfaceResourceRegistryClient- 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 retrieveuuid- 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 UUIDorg.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException- If the element exists but is not accessible for context listingorg.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.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Specified by:
getInstanceContextsin interfaceResourceRegistryClient- 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 UUIDorg.gcube.informationsystem.resourceregistry.api.exceptions.instances.AvailableInAnotherContextException- If the element exists but is not accessible for context listingorg.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.ResourceRegistryExceptionRetrieves 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:
getAllQueryTemplatesin interfaceResourceRegistryClient- 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:
existQueryTemplatein interfaceResourceRegistryClient- 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 checkorg.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:
existQueryTemplatein interfaceResourceRegistryClient- 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 checkorg.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 configuredmetadataPolicy; 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:
readQueryTemplatein interfaceResourceRegistryClient- 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 existorg.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:
readQueryTemplatein interfaceResourceRegistryClient- 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 existorg.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:
readQueryTemplateAsStringin interfaceResourceRegistryClient- 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 existorg.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:
runQueryTemplatein interfaceResourceRegistryClient- 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 existorg.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:
runQueryTemplatein interfaceResourceRegistryClient- 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 existorg.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:
runQueryTemplatein interfaceResourceRegistryClient- Parameters:
name- The name of the query template to executeparams- 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 existorg.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:
runQueryTemplatein interfaceResourceRegistryClient- Parameters:
name- The name of the query template to executejsonNode- 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 existorg.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:
runQueryTemplatein interfaceResourceRegistryClient- 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 existorg.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:
queryContextsin interfaceResourceRegistryClient- 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 invalidorg.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 configuredlimit,offset, and metadata policy. This searches templates themselves; useResourceRegistryClient.runQueryTemplate(String, String)to run one.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Specified by:
queryQueryTemplatesin interfaceResourceRegistryClient- 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 invalidorg.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:
jsonQueryin interfaceResourceRegistryClient- 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 errorsorg.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 ofResourceRegistryClient.jsonQuery(String), deserializing the JSON query result into strongly-typedEntityinstances.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Specified by:
jsonQueryin interfaceResourceRegistryClient- 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 errorsorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- If an error occurs during query execution
-
getTypeFromServer(Class, int)with depth instead.