Class InstanceEnvironmentRegistry
java.lang.Object
org.gcube.informationsystem.resourceregistry.instances.InstanceEnvironmentRegistry
Server-side registry and resolution hub for
InstanceEnvironment objects.
This class is a 100% stateless utility resolution hub. It retrieves current request credentials
and builds transient, lightweight InstanceEnvironment hierarchies dynamically on-the-fly
to guarantee strict multi-node distributed cache coherence.
- Author:
- Luca Frosini (ISTI - CNR)
-
Method Summary
Modifier and TypeMethodDescriptionstatic InstanceEnvironmentResolves theInstanceEnvironmentthat corresponds to the caller's token Context (TokenContextResolution.current()).static InstanceEnvironmentgetEnvironmentByUUID(UUID uuid) Resolves theInstanceEnvironmentfor the given context UUID.static InstanceEnvironmentResolves theInstanceEnvironmentfor the given context path.
-
Method Details
-
getCurrentRequestEnvironment
public static InstanceEnvironment getCurrentRequestEnvironment() throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryExceptionResolves theInstanceEnvironmentthat corresponds to the caller's token Context (TokenContextResolution.current()).- Returns:
- the resolved
InstanceEnvironmentfor the current request - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the security context has not been set or the context cannot be resolved
-
getRequestEnvironmentByContextPath
public static InstanceEnvironment getRequestEnvironmentByContextPath(String path) throws org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextException Resolves theInstanceEnvironmentfor the given context path. Delegates resolution entirely toContextRepository, which manages the caching layer before hitting the database.- Parameters:
path- the fully-qualified context path, e.g./gcube/devsec/devVRE- Returns:
- the resolved
InstanceEnvironment - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.contexts.ContextException- if the context cannot be resolved
-
getEnvironmentByUUID
public static InstanceEnvironment getEnvironmentByUUID(UUID uuid) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Resolves theInstanceEnvironmentfor the given context UUID. Loads theContextviaContextRepositoryand recursively resolves the parent chain dynamically on-the-fly without JVM-local caching.- Parameters:
uuid- the UUID of the context- Returns:
- the resolved
InstanceEnvironment - Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the context cannot be found
-