Record Class BackupTransferConfiguration

java.lang.Object
java.lang.Record
zeroecho.pki.server.BackupTransferConfiguration
Record Components:
directory - exclusively owned artifact directory
maximumArchiveBytes - compressed bytes allowed in one transfer
maximumRetainedBytes - total reserved compressed artifact bytes
maximumArtifacts - maximum live descriptors, including incomplete uploads
maximumConcurrentJobs - maximum simultaneous transfer or domain jobs
maximumWorkspaceBytes - aggregate domain-workspace admission budget
lifetime - lifetime measured from artifact reservation, not last access
transferTimeout - maximum duration of one network transfer
browserOrigin - exact origin allowed to submit browser transfer requests

public record BackupTransferConfiguration(Path directory, long maximumArchiveBytes, long maximumRetainedBytes, int maximumArtifacts, int maximumConcurrentJobs, long maximumWorkspaceBytes, Duration lifetime, Duration transferTimeout, URI browserOrigin) extends Record
Explicit, opt-in budgets for remote backup transfer. No enabled defaults exist. The separate document preserves the schema and record shape of the server configuration. Artifact storage must be outside the replaceable PKI root, in a pre-existing, durably provisioned directory accessible only to its owner.

Workspace bytes are an admission reservation, not an operating-system disk quota. Administrators must provision recovery/index headroom and filesystem quotas in addition to the archive and expansion limits.

  • Field Details

    • VERSION

      public static final int VERSION
      Version of the separate transfer configuration document.
      See Also:
  • Constructor Details

    • BackupTransferConfiguration

      public BackupTransferConfiguration(Path directory, long maximumArchiveBytes, long maximumRetainedBytes, int maximumArtifacts, int maximumConcurrentJobs, long maximumWorkspaceBytes, Duration lifetime, Duration transferTimeout, URI browserOrigin)
      Validates mandatory budgets without creating directories or opening stores.
  • Method Details

    • workspaceReservationBytes

      public long workspaceReservationBytes()
      Returns the minimum reservation for one verification or restore job. Recovery/index workspace above this floor remains part of the operator's provisioned filesystem headroom.
      Returns:
      archive plus two maximum expanded trees, in bytes
    • read

      public static BackupTransferConfiguration read(Path path) throws IOException
      Reads an explicit bounded configuration. Every field is mandatory.
      Parameters:
      path - configuration file
      Returns:
      validated immutable settings
      Throws:
      IOException - if reading fails or the document exceeds its byte limit
      IllegalArgumentException - if fields, types or budgets are invalid
    • decode

      public static BackupTransferConfiguration decode(byte[] bytes)
      Parses a closed version-1 transfer configuration.
      Parameters:
      bytes - bounded UTF-8 JSON
      Returns:
      validated settings
      Throws:
      IllegalArgumentException - if the document is invalid
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • directory

      public Path directory()
      Returns the value of the directory record component.
      Returns:
      the value of the directory record component
    • maximumArchiveBytes

      public long maximumArchiveBytes()
      Returns the value of the maximumArchiveBytes record component.
      Returns:
      the value of the maximumArchiveBytes record component
    • maximumRetainedBytes

      public long maximumRetainedBytes()
      Returns the value of the maximumRetainedBytes record component.
      Returns:
      the value of the maximumRetainedBytes record component
    • maximumArtifacts

      public int maximumArtifacts()
      Returns the value of the maximumArtifacts record component.
      Returns:
      the value of the maximumArtifacts record component
    • maximumConcurrentJobs

      public int maximumConcurrentJobs()
      Returns the value of the maximumConcurrentJobs record component.
      Returns:
      the value of the maximumConcurrentJobs record component
    • maximumWorkspaceBytes

      public long maximumWorkspaceBytes()
      Returns the value of the maximumWorkspaceBytes record component.
      Returns:
      the value of the maximumWorkspaceBytes record component
    • lifetime

      public Duration lifetime()
      Returns the value of the lifetime record component.
      Returns:
      the value of the lifetime record component
    • transferTimeout

      public Duration transferTimeout()
      Returns the value of the transferTimeout record component.
      Returns:
      the value of the transferTimeout record component
    • browserOrigin

      public URI browserOrigin()
      Returns the value of the browserOrigin record component.
      Returns:
      the value of the browserOrigin record component