AbstractAbstractArchiveArchives a single record: writes the archive document to storage and optionally nullifies the archived fields on the source record.
The archive context including record, storage driver, etc.
Result indicating success/failure and storage details
ProtectedBuildBuilds the ArchiveDocument JSON structure from a record context.
The archive context
The timestamp for this version
A fully populated ArchiveDocument
ProtectedBuildBuilds a storage path for an archive document.
Format: {basePath}/{SanitizedEntityName}/{RecordID}/{VersionStamp}.json
The configured base path prefix
The entity name (will be sanitized)
The primary key value of the record
The timestamp for this archive version
The full storage path string
ProtectedExtractExtracts the values of fields configured for archiving from the record.
ProtectedExtractExtracts a full record snapshot if configured, otherwise returns null.
ProtectedExtractExtracts the primary key fields and values from a BaseEntity record.
ProtectedFormatFormats a Date as an ISO 8601 string safe for use in file paths. Colons are replaced with underscores.
AbstractRestoreRestores a previously archived record by reading the archive document from storage and setting the field values back on the source record.
The restore context including the ArchiveRunDetail record
Result indicating success/failure and which fields were restored
ProtectedSanitizeSanitizes a string for use as a storage path segment by replacing spaces, colons, and other problematic characters with underscores.
AbstractShouldDetermines whether a given record should be archived based on its current field values.
The archive context including record, field config, etc.
True if the record should be archived, false to skip it
Abstract base class for archive drivers. Concrete implementations handle the specifics of how records are archived and restored.
Use
@RegisterClass(BaseArchiveDriver, 'YourDriverName')on concrete subclasses to make them discoverable via the MJ ClassFactory.