Class SystemPolicyEnforcementPoint
java.lang.Object
org.gcube.informationsystem.resourceregistry.pep.PolicyEnforcementPoint
org.gcube.informationsystem.resourceregistry.system.SystemPolicyEnforcementPoint
Policy Enforcement Point for whole-system administrative operations (System Dump,
System Restore).
- Author:
- Luca Frosini (ISTI - CNR)
-
Nested Class Summary
Nested classes/interfaces inherited from class org.gcube.informationsystem.resourceregistry.pep.PolicyEnforcementPoint
PolicyEnforcementPoint.EndpointPolicySpec, PolicyEnforcementPoint.QueryParamSpec, PolicyEnforcementPoint.TokenScopeRule -
Field Summary
Fields inherited from class org.gcube.informationsystem.resourceregistry.pep.PolicyEnforcementPoint
ALL_ADMIN_ROLES, ALL_OPERATIONAL_ROLES, CONTEXT_MANAGER, DEPTH_DEFAULT, GLOBAL_PRIVILEGED_ROLES, INFRASTRUCTURE_MANAGER, IS_ADMIN, IS_CONTRIBUTOR, IS_EDITOR, IS_MANAGER, IS_MEMBER, LEGACY_ALL_META_QUERY_PARAMETER, LEGACY_INCLUDE_META_QUERY_PARAMETER, LIMIT_DEFAULT, LIMIT_MAX, OFFSET_DEFAULT, requestContext, SUBTREE_ADMIN_ROLES -
Constructor Summary
ConstructorsConstructorDescriptionSystemPolicyEnforcementPoint(jakarta.ws.rs.container.ContainerRequestContext requestContext) Creates a newSystemPolicyEnforcementPointfor the current HTTP request. -
Method Summary
Modifier and TypeMethodDescriptionvoidEnforces System Dump authorization before a streaming HTTP response is created.voiddump(OutputStream outputStream) Writes a complete System Dump ZIP archive to the given output stream.voidrestore(InputStream inputStream) Ingests a System Dump ZIP archive, recreating the entire Resource Registry state.Methods inherited from class org.gcube.informationsystem.resourceregistry.pep.PolicyEnforcementPoint
addContentWarning, addIgnoredFieldsWarning, addLink, addPaginationLinks, addPreferenceApplied, addQueryParameterWarning, addResultScope, buildUri, enforcePolicy, enforceTargetContextWithinTokenSubtree, getAllWarnings, getContentLocation, getContentWarnings, getIgnoredFieldsWarnings, getLinks, getPreferenceApplied, getQueryParameterWarnings, getResolvedContextPath, getResultScopes, getUriInfo, hasNonActiveDescendant, isAdministrativeUser, isPrivilegedUser, isUserAllowed, resolveAllMeta, resolveBoolean, resolveBypassHierarchyCheck, resolveDepth, resolveDepth, resolveDryRun, resolveHierarchical, resolveIncludeContexts, resolveIncludeMeta, resolveLimit, resolveMetadataPolicy, resolveOffset, resolvePolymorphic, resolvePropagationMode, resolveRawResult, resolveSyncExistingHierarchy, resolveTokenContextUuid, setContentLocation, validateQueryParameters, warnEnrichmentParametersIgnoredByEmitProjection
-
Constructor Details
-
SystemPolicyEnforcementPoint
public SystemPolicyEnforcementPoint(jakarta.ws.rs.container.ContainerRequestContext requestContext) Creates a newSystemPolicyEnforcementPointfor the current HTTP request.- Parameters:
requestContext- the JAX-RSContainerRequestContextfor the current request
-
-
Method Details
-
dump
public void dump(OutputStream outputStream) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Writes a complete System Dump ZIP archive to the given output stream. Restricted to IS-Manager / Infrastructure-Manager; the operation is not scoped to the caller's token Context, as it captures the complete persisted state.- Parameters:
outputStream- the destination stream for the ZIP archive- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if any collection cannot be read
-
authorizeDump
public void authorizeDump()Enforces System Dump authorization before a streaming HTTP response is created. -
restore
public void restore(InputStream inputStream) throws org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException Ingests a System Dump ZIP archive, recreating the entire Resource Registry state. Restricted to IS-Manager / Infrastructure-Manager; the operation is not scoped to the caller's token Context, as it replays the complete persisted state from the archive.- Parameters:
inputStream- the ZIP archive stream- Throws:
org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException- if the archive is malformed or any collection cannot be restored
-