Class SystemPolicyEnforcementPoint

java.lang.Object
org.gcube.informationsystem.resourceregistry.pep.PolicyEnforcementPoint
org.gcube.informationsystem.resourceregistry.system.SystemPolicyEnforcementPoint

public class SystemPolicyEnforcementPoint extends PolicyEnforcementPoint
Policy Enforcement Point for whole-system administrative operations (System Dump, System Restore).
Author:
Luca Frosini (ISTI - CNR)
  • Constructor Details

    • SystemPolicyEnforcementPoint

      public SystemPolicyEnforcementPoint(jakarta.ws.rs.container.ContainerRequestContext requestContext)
      Creates a new SystemPolicyEnforcementPoint for the current HTTP request.
      Parameters:
      requestContext - the JAX-RS ContainerRequestContext for 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