Interface ResourceRegistryContextClient
- All Superinterfaces:
org.gcube.informationsystem.resourceregistry.api.request.RequestInfo
- All Known Implementing Classes:
ResourceRegistryContextClientImpl
The interface is the authoritative caller-facing contract. Stable invocation options are
represented by immutable request options, while HTTP metadata is available through the opt-in
response executor without changing ordinary domain-oriented return values. Standard Context
representations always include previousPaths, including an empty list, immediately after
path in their JSON form.
- Author:
- Luca Frosini (ISTI - CNR)
-
Field Summary
Fields inherited from interface org.gcube.informationsystem.resourceregistry.api.request.RequestInfo
DEFAULT_LIMIT, DEFAULT_OFFSET, UNBOUNDED_LIMIT -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.voidDeprecated.use per-request custom headers fromResourceRegistryRequestOptionsList<org.gcube.informationsystem.contexts.reference.entities.Context>all()Retrieves all live Contexts through the local cache.List<org.gcube.informationsystem.contexts.reference.entities.Context>all(org.gcube.informationsystem.resourceregistry.api.rest.ContextLifecycle lifecycle) Retrieves a page of Contexts from the server for the requested lifecycle slice, bypassing the local Context cache.changeState(String context) JSON-string counterpart ofchangeState(Context).changeState(String uuid, String state) String-based counterpart ofchangeState(UUID, ContextState).org.gcube.informationsystem.contexts.reference.entities.ContextchangeState(UUID uuid, org.gcube.informationsystem.contexts.reference.ContextState state) Changes only the state of an existing context, identified by UUID, sending a minimal merge-patch body ({"state": ...}) that cannot affectnameorparent.org.gcube.informationsystem.contexts.reference.entities.ContextchangeState(org.gcube.informationsystem.contexts.reference.entities.Context context) Changes only the state of an existing Context, extracting its UUID and state from the supplied object.Creates a Context from a JSON document supplied through the Java API as aString.org.gcube.informationsystem.contexts.reference.entities.Contextcreate(org.gcube.informationsystem.contexts.reference.entities.Context context) Creates a Context throughPUT /contexts/{context-uuid}.booleanParsesuuidand delegates todelete(UUID)without changing its logical-deletion, authorization, cache, retry, or response-metadata semantics.booleanLogically deletes a live Context, removing it from the active topology while retaining its state and history in the cemetery.booleandelete(org.gcube.informationsystem.contexts.reference.entities.Context context) Extracts the Context identifier and delegates todelete(UUID)without changing its logical-deletion, authorization, cache, or response-metadata semantics.booleanChecks if a context with the specified UUID (as string) exists in the system.booleanChecks if a context with the specified UUID exists in the system.org.gcube.informationsystem.resourceregistry.api.contexts.ContextCacheGets the context cache used for context-related operations.List<org.gcube.informationsystem.contexts.reference.entities.Context>Executes a JSON Query-By-Example against live Contexts.List<org.gcube.informationsystem.contexts.reference.entities.Context>query(String jsonQuery, org.gcube.informationsystem.resourceregistry.api.rest.ContextLifecycle lifecycle) Executes a JSON Query-By-Example against Contexts, restricted to the given lifecycle slice.Parses the UUID, delegates toread(UUID), and serializes the resulting Context hierarchy.Parses the UUID, delegates toread(UUID, int), and serializes the resulting Context hierarchy.org.gcube.informationsystem.contexts.reference.entities.ContextRetrieves a Context by UUID with root-only depth.org.gcube.informationsystem.contexts.reference.entities.ContextRetrieves a Context by UUID and expands descendants to the requested depth.org.gcube.informationsystem.contexts.reference.entities.Contextread(org.gcube.informationsystem.contexts.reference.entities.Context context) Retrieves a Context by delegating its identifier toread(UUID).org.gcube.informationsystem.contexts.reference.entities.Contextread(org.gcube.informationsystem.contexts.reference.entities.Context context, int depth) Retrieves a Context by delegating its identifier anddepthtoread(UUID, int).org.gcube.informationsystem.contexts.reference.entities.ContextRetrieves the Context associated with the authorization token using root-only depth.org.gcube.informationsystem.contexts.reference.entities.ContextreadCurrentContext(int depth) Retrieves the Context resolved by the server from the authorization token and expands descendants to the requested depth.List<org.gcube.informationsystem.model.reference.properties.Event>readHistory(String uuid) Parsesuuidand delegates toreadHistory(UUID)without changing its history, authorization, or response-metadata semantics.List<org.gcube.informationsystem.model.reference.properties.Event>readHistory(UUID uuid) Retrieves the complete audit trail of a Context in reverse-chronological order, with the newestEventfirst.Full-Context JSON counterpart ofupdate(Context).Applies an RFC 7396 merge patch to the Context identified byuuid.org.gcube.informationsystem.contexts.reference.entities.Contextupdate(org.gcube.informationsystem.contexts.reference.entities.Context context) Performs a Tracked Update of an existing context:state,name, andparent(as carried by the given object's getters) are sent to the server and applied atomically.Methods inherited from interface org.gcube.informationsystem.resourceregistry.api.request.RequestInfo
allMeta, getLimit, getOffset, includeContexts, includeMeta, isHierarchicalMode, serverResponses, setAllMeta, setHierarchicalMode, setIncludeContexts, setIncludeMeta, setLimit, setOffset
-
Method Details
-
addHeader
Deprecated.use per-request custom headers fromResourceRegistryRequestOptionsAdds a custom HTTP header to be included in requests.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Parameters:
name- Header namevalue- Header value
-
addHeader
Deprecated.use per-request custom headers fromResourceRegistryRequestOptionsAdds a custom HTTP header to be included in requests.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Parameters:
name- Header namevalue- boolean value
-
getContextCache
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().- Returns:
- The context cache instance
-
all
List<org.gcube.informationsystem.contexts.reference.entities.Context> all() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionRetrieves all live Contexts through the local cache.Invocation-specific List options force a server-backed request so that pagination, metadata policy, lifecycle selection, and response metadata remain observable. Use
all(ContextLifecycle)for an explicit lifecycle selection.- Returns:
- all cached live Contexts, or the effective server page when request options are active
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if retrieval fails or the caller is not authorized
-
all
List<org.gcube.informationsystem.contexts.reference.entities.Context> all(org.gcube.informationsystem.resourceregistry.api.rest.ContextLifecycle lifecycle) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Retrieves a page of Contexts from the server for the requested lifecycle slice, bypassing the local Context cache.A
nulllifecycle omits the wire-levellifecyclequery parameter and uses the server default (live). Valuesdeletedandallrequire an IS-Manager or Infrastructure-Manager role and otherwise produce an authorization error. Pagination and metadata settings come from this client, while invocation-specific options supplied throughRequestInfo.serverResponses()take precedence.- Parameters:
lifecycle- lifecycle slice to retrieve, ornullfor the server default- Returns:
- Contexts in the requested lifecycle slice for the effective page
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if retrieval fails or the caller cannot request the lifecycle
-
query
List<org.gcube.informationsystem.contexts.reference.entities.Context> query(String jsonQuery) throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Executes a JSON Query-By-Example against live Contexts. Equivalent toquery(String, ContextLifecycle)with anulllifecycle (server default: live contexts only).Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Parameters:
jsonQuery- the JSON Query-By-Example payload- Returns:
- the matching Context objects
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException- if the query syntax is invalidorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the query cannot be executed due to authorization issues or other errors
-
query
List<org.gcube.informationsystem.contexts.reference.entities.Context> query(String jsonQuery, org.gcube.informationsystem.resourceregistry.api.rest.ContextLifecycle lifecycle) throws org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Executes a JSON Query-By-Example against Contexts, restricted to the given lifecycle slice.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Parameters:
jsonQuery- the JSON Query-By-Example payloadlifecycle- the Context lifecycle slice to search (nullfor the server default,live);deletedandallare restricted to IS-Manager / Infrastructure-Manager- Returns:
- the matching Context objects
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.queries.InvalidQueryException- if the query syntax is invalidorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the query cannot be executed due to authorization issues or other errors
-
create
org.gcube.informationsystem.contexts.reference.entities.Context create(org.gcube.informationsystem.contexts.reference.entities.Context context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Creates a Context throughPUT /contexts/{context-uuid}. A UUID is generated and assigned to the supplied object when absent. Repeating a congruent representation is an idempotent success; an incongruent representation for an existing UUID is rejected.The caller must use an administrative token for the immediate parent Context. Root creation requires an IS-Manager or Infrastructure-Manager token for the exact Root path. Request options, including
metadataPolicy, and immutable response status, headers, and body are available through the invocation context andRequestInfo.serverResponses(). SuppliedstateandpreviousPathsvalues are ignored with a warning; historical paths are administered byupdate(UUID, String).- Parameters:
context- the Context to create- Returns:
- the server representation of the created or congruent existing Context
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentException- if the UUID exists with an incongruent representationorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if serialization, transport, validation, or authorization fails- See Also:
-
create
String create(String context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Creates a Context from a JSON document supplied through the Java API as aString. The document is decoded locally, assigned a UUID when absent, and sent as an object-valued JSON body throughPUT /contexts/{context-uuid}.Authorization, idempotency, request-option, and response-metadata behavior is identical to
create(Context).- Parameters:
context- the object-valued JSON document represented as a Java string- Returns:
- the server JSON representation of the created or congruent existing Context
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextAlreadyPresentException- if the UUID exists with an incongruent representationorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if decoding, serialization, transport, validation, or authorization fails- See Also:
-
exist
boolean exist(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Checks if a context with the specified UUID exists in the system.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Parameters:
uuid- the UUID of the context to check for existence- Returns:
trueif the context exists and is accessible to the current user,falseotherwise- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if there are communication errors with the Resource Registry service
-
exist
boolean exist(String uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Checks if a context with the specified UUID (as string) exists in the system.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Parameters:
uuid- the UUID of the context (as string) to check for existence- Returns:
trueif the context exists and is accessible to the current user,falseotherwise- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if there are communication errors with the Resource Registry serviceIllegalArgumentException- if the provided string is not a valid UUID format
-
read
org.gcube.informationsystem.contexts.reference.entities.Context read(org.gcube.informationsystem.contexts.reference.entities.Context context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Retrieves a Context by delegating its identifier toread(UUID).- Parameters:
context- the context object containing the UUID to retrieve- Returns:
- the complete Context object with role-appropriate detail level
- 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 there are communication errors or authorization issues
-
read
org.gcube.informationsystem.contexts.reference.entities.Context read(org.gcube.informationsystem.contexts.reference.entities.Context context, int depth) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Retrieves a Context by delegating its identifier anddepthtoread(UUID, int).- Parameters:
context- the context object containing the UUID to retrievedepth-ContextPath.DEPTH_ROOT_ONLYfor the context alone, a positive integer for that many levels of descendants, orContextPath.DEPTH_UNLIMITEDfor the full subtree- Returns:
- the Context object, with
childrenpopulated according todepth - 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 there are communication errors or authorization issues
-
read
org.gcube.informationsystem.contexts.reference.entities.Context read(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Retrieves a Context by UUID with root-only depth. This is equivalent toread(UUID, int)withContextPath.DEPTH_ROOT_ONLY.When no invocation options are active, a matching local cache entry may satisfy the call. An explicit metadata policy, depth, or custom request setting forces a server request so the option and response metadata remain observable through
RequestInfo.serverResponses().- Parameters:
uuid- the UUID of the context to retrieve- Returns:
- the Context object with role-appropriate detail level
- 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 there are communication errors or authorization issues
-
read
org.gcube.informationsystem.contexts.reference.entities.Context read(UUID uuid, int depth) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Retrieves a Context by UUID and expands descendants to the requested depth. The server's flat result is returned as one rooted Context hierarchy; child summaries beyond the requested depth remain summaries.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses(). ThemetadataPolicyanddepthrequest options map to the corresponding query parameters and take precedence for that invocation. If authorization resolves the token through a retained previous path, the response metadata exposesX-Result-Scope: previous-pathandX-Resolved-Context-Path.- Parameters:
uuid- the UUID of the context to retrievedepth-ContextPath.DEPTH_ROOT_ONLYfor the context alone, a positive integer for that many levels of descendants, orContextPath.DEPTH_UNLIMITEDfor the full subtree- Returns:
- the Context object, with
childrenpopulated according todepth - 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 communication, deserialization, or authorization fails; direct reads require a self token, except that administrative callers may use an ancestor token
-
read
String read(String uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Parses the UUID, delegates toread(UUID), and serializes the resulting Context hierarchy.- Parameters:
uuid- the UUID of the context (as string) to retrieve- Returns:
- the Context as JSON string with role-appropriate detail level
- 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 there are communication errors or authorization issuesIllegalArgumentException- if the provided string is not a valid UUID format
-
read
String read(String uuid, int depth) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Parses the UUID, delegates toread(UUID, int), and serializes the resulting Context hierarchy.- Parameters:
uuid- the UUID of the context (as string) to retrievedepth-ContextPath.DEPTH_ROOT_ONLYfor the context alone, a positive integer for that many levels of descendants, orContextPath.DEPTH_UNLIMITEDfor the full subtree- Returns:
- the Context as JSON string, with
childrenpopulated according todepth - 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 there are communication errors or authorization issuesIllegalArgumentException- if the provided string is not a valid UUID format
-
readCurrentContext
org.gcube.informationsystem.contexts.reference.entities.Context readCurrentContext() throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionRetrieves the Context associated with the authorization token using root-only depth. This is equivalent toreadCurrentContext(int)withContextPath.DEPTH_ROOT_ONLY.- Returns:
- the Context object associated with the current authorization token
- 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 there are communication errors or authorization issues
-
readCurrentContext
org.gcube.informationsystem.contexts.reference.entities.Context readCurrentContext(int depth) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Retrieves the Context resolved by the server from the authorization token and expands descendants to the requested depth. This operation always uses the server so token-resolution outcomes and response metadata remain authoritative.The
depthandmetadataPolicyrequest options map to the corresponding query parameters and take precedence for that invocation. Response warnings, links, and canonical content location are available throughRequestInfo.serverResponses(). When the token path matches a retained previous path, the response metadata containsX-Result-Scope: previous-pathandX-Resolved-Context-Pathwith the current path.- Parameters:
depth-ContextPath.DEPTH_ROOT_ONLYfor the context alone, a positive integer for that many levels of descendants, orContextPath.DEPTH_UNLIMITEDfor the full subtree- Returns:
- the Context object, with
childrenpopulated according todepth - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException- if the token path resolves to no live or deleted Contextorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if communication, deserialization, or authorization fails; non-manager access to a deleted token Context is rejected
-
update
org.gcube.informationsystem.contexts.reference.entities.Context update(org.gcube.informationsystem.contexts.reference.entities.Context context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Performs a Tracked Update of an existing context:state,name, andparent(as carried by the given object's getters) are sent to the server and applied atomically. The object'spreviousPathsare deliberately omitted so a stale full representation cannot replace the server's retained set; useupdate(UUID, String)for an explicit replacement.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses(), including previous-path resolution headers when applicable.- Parameters:
context- a Context object (typically obtained viaread()) carrying the UUID to update and the desiredstate/name/parent- Returns:
- the updated Context object with complete information
- 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 the update is rejected (e.g. rename/reparent whileACTIVE) or fails due to authorization issues or other errors
-
update
String update(UUID uuid, String mergePatchJson) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Applies an RFC 7396 merge patch to the Context identified byuuid. The Java API accepts the object-valued JSON document as aString; it is transmitted unchanged withContent-Type: application/merge-patch+json.The patch may contain
state,name,parent, andpreviousPaths. The latter is null or an array of absolute path strings and replaces the complete retained set. Other fields are ignored with a warning. Invocation-specific options and immutable response metadata, including warnings, links, content location, and previous-path resolution headers, are available throughRequestInfo.serverResponses().- Parameters:
uuid- the UUID of the Context to updatemergePatchJson- the object-valued merge-patch document represented as a Java string- Returns:
- the complete updated Context representation as JSON
- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException- if the Context or requested new parent does not existorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if decoding, transport, validation, authorization, or update fails
-
update
String update(String context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Full-Context JSON counterpart ofupdate(Context). The Java string is decoded as aContext; onlystate,name, andparentare sent. Useupdate(UUID, String)to replacepreviousPathsor preserve another arbitrary partial merge-patch document unchanged.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Parameters:
context- the JSON string representation of the context carrying the UUID and the desiredstate/name/parent- Returns:
- the updated context as JSON string with complete information
- 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 the update is rejected (e.g. rename/reparent whileACTIVE) or fails due to authorization issues, invalid JSON, or other errors
-
delete
boolean delete(org.gcube.informationsystem.contexts.reference.entities.Context context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Extracts the Context identifier and delegates todelete(UUID)without changing its logical-deletion, authorization, cache, or response-metadata semantics.- Parameters:
context- the non-null Context whose non-null identifier selects the deletion target- Returns:
truewhen the server confirms logical deletion- 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 deletion is rejected or failsIllegalArgumentException- ifcontextor its identifier isnull
-
delete
boolean delete(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Logically deletes a live Context, removing it from the active topology while retaining its state and history in the cemetery. A successful bodyless response returnstrue; this method never usesfalseto represent a server error.The caller must hold an administrative role with a token for the target's immediate parent, or for the target itself when deleting a Root Context. Deletion is rejected while the Context has children or graph instances. The operation supports no query options; unsupported raw query parameters are ignored with
X-Warning. The local cache is invalidated without issuing a follow-up request. Immutable status, warning, and request metadata are available throughRequestInfo.serverResponses(); this includes the two previous-path resolution headers when parent scope was established through a retained path.Deletion is effect-idempotent: retrying after success leaves the Context deleted but raises
ContextNotFoundException, because the UUID is no longer in the live topology.- Parameters:
uuid- the non-null UUID of the live Context to delete- Returns:
truewhen the server confirms logical deletion- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException- if the UUID is unknown or already in the cemeteryorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if authorization, a non-empty Context, transport, or another registry operation prevents deletionIllegalArgumentException- ifuuidisnull
-
delete
boolean delete(String uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Parsesuuidand delegates todelete(UUID)without changing its logical-deletion, authorization, cache, retry, or response-metadata semantics.- Parameters:
uuid- the non-null textual UUID of the live Context to delete- Returns:
truewhen the server confirms logical deletion- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException- if the UUID is unknown or already in the cemeteryorg.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if deletion is rejected or failsIllegalArgumentException- ifuuidis null or is not a valid UUID
-
readHistory
List<org.gcube.informationsystem.model.reference.properties.Event> readHistory(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Retrieves the complete audit trail of a Context in reverse-chronological order, with the newestEventfirst. A Context without recorded events produces an empty list.The caller must have an administrative role and use a token for the target Context or any ancestor. Only globally privileged roles can read deleted Context history. This operation has no query options; unsupported query parameters sent outside this typed API are ignored by the service with an
X-Warning. Immutable response metadata, including that warning and therel=uplink, is available throughRequestInfo.serverResponses(). The history includes independent additions, removals, cascades, and path-reuse collision events forpreviousPaths; previous-path token resolution is exposed through response headers.- Parameters:
uuid- the non-null UUID of the Context whose history to read- Returns:
- the complete reverse-chronological history, possibly empty
- 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 authorization, transport, response decoding, or another registry operation failsIllegalArgumentException- ifuuidisnull
-
readHistory
List<org.gcube.informationsystem.model.reference.properties.Event> readHistory(String uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Parsesuuidand delegates toreadHistory(UUID)without changing its history, authorization, or response-metadata semantics.- Parameters:
uuid- the non-null textual UUID of the Context whose history to read- Returns:
- the complete reverse-chronological history, possibly empty
- 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 authorization, transport, response decoding, or another registry operation failsIllegalArgumentException- ifuuidis null or is not a valid UUID
-
changeState
org.gcube.informationsystem.contexts.reference.entities.Context changeState(org.gcube.informationsystem.contexts.reference.entities.Context context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Changes only the state of an existing Context, extracting its UUID and state from the supplied object. The client sends a minimal merge patch, so the object's name and parent cannot be modified by this method.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Parameters:
context- the context object containing the UUID and the new state to apply- Returns:
- the complete Context object with the updated state and full metadata
- 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 the state cannot be changed due to authorization issues, invalid state, or other errors
-
changeState
String changeState(String context) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException JSON-string counterpart ofchangeState(Context). The Java string is decoded locally to obtain the UUID and state; the client sends only the resulting minimal state merge patch.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Parameters:
context- the JSON string representation containing the context UUID and new state- Returns:
- the complete updated context as JSON string with the new state and full metadata
- 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 the state cannot be changed due to authorization issues, invalid state, invalid JSON, or other errors
-
changeState
org.gcube.informationsystem.contexts.reference.entities.Context changeState(UUID uuid, org.gcube.informationsystem.contexts.reference.ContextState state) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Changes only the state of an existing context, identified by UUID, sending a minimal merge-patch body ({"state": ...}) that cannot affectnameorparent.Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Parameters:
uuid- the UUID of the context whose state should be changedstate- the new state to apply to the context- Returns:
- the complete Context object with the updated state and full metadata
- 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 the state cannot be changed due to authorization issues, invalid state, or other errors
-
changeState
String changeState(String uuid, String state) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextNotFoundException, org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException String-based counterpart ofchangeState(UUID, ContextState).Invocation-specific options and immutable response metadata are available through
RequestInfo.serverResponses().- Parameters:
uuid- the UUID of the context (as string) whose state should be changedstate- the new state (as string) to apply to the context- Returns:
- the complete updated context as JSON string with the new state and full metadata
- 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 the state cannot be changed due to authorization issues, invalid state, or other errorsIllegalArgumentException- if the provided UUID string is not a valid UUID format or if the state string is not a valid ContextState value
-
ResourceRegistryRequestOptions