Record Class BackupTransferConfiguration
java.lang.Object
java.lang.Record
zeroecho.pki.server.BackupTransferConfiguration
- Record Components:
directory- exclusively owned artifact directorymaximumArchiveBytes- compressed bytes allowed in one transfermaximumRetainedBytes- total reserved compressed artifact bytesmaximumArtifacts- maximum live descriptors, including incomplete uploadsmaximumConcurrentJobs- maximum simultaneous transfer or domain jobsmaximumWorkspaceBytes- aggregate domain-workspace admission budgetlifetime- lifetime measured from artifact reservation, not last accesstransferTimeout- maximum duration of one network transferbrowserOrigin- 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intVersion of the separate transfer configuration document. -
Constructor Summary
ConstructorsConstructorDescriptionBackupTransferConfiguration(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 Summary
Modifier and TypeMethodDescriptionReturns the value of thebrowserOriginrecord component.static BackupTransferConfigurationdecode(byte[] bytes) Parses a closed version-1 transfer configuration.Returns the value of thedirectoryrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.lifetime()Returns the value of thelifetimerecord component.longReturns the value of themaximumArchiveBytesrecord component.intReturns the value of themaximumArtifactsrecord component.intReturns the value of themaximumConcurrentJobsrecord component.longReturns the value of themaximumRetainedBytesrecord component.longReturns the value of themaximumWorkspaceBytesrecord component.static BackupTransferConfigurationReads an explicit bounded configuration.final StringtoString()Returns a string representation of this record class.Returns the value of thetransferTimeoutrecord component.longReturns the minimum reservation for one verification or restore job.
-
Field Details
-
VERSION
public static final int VERSIONVersion 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
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 limitIllegalArgumentException- if fields, types or budgets are invalid
-
decode
Parses a closed version-1 transfer configuration.- Parameters:
bytes- bounded UTF-8 JSON- Returns:
- validated settings
- Throws:
IllegalArgumentException- if the document is invalid
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
directory
-
maximumArchiveBytes
public long maximumArchiveBytes()Returns the value of themaximumArchiveBytesrecord component.- Returns:
- the value of the
maximumArchiveBytesrecord component
-
maximumRetainedBytes
public long maximumRetainedBytes()Returns the value of themaximumRetainedBytesrecord component.- Returns:
- the value of the
maximumRetainedBytesrecord component
-
maximumArtifacts
public int maximumArtifacts()Returns the value of themaximumArtifactsrecord component.- Returns:
- the value of the
maximumArtifactsrecord component
-
maximumConcurrentJobs
public int maximumConcurrentJobs()Returns the value of themaximumConcurrentJobsrecord component.- Returns:
- the value of the
maximumConcurrentJobsrecord component
-
maximumWorkspaceBytes
public long maximumWorkspaceBytes()Returns the value of themaximumWorkspaceBytesrecord component.- Returns:
- the value of the
maximumWorkspaceBytesrecord component
-
lifetime
-
transferTimeout
Returns the value of thetransferTimeoutrecord component.- Returns:
- the value of the
transferTimeoutrecord component
-
browserOrigin
Returns the value of thebrowserOriginrecord component.- Returns:
- the value of the
browserOriginrecord component
-