Package io.ocfl.core
Class DefaultMutableOcflRepository
java.lang.Object
io.ocfl.core.DefaultOcflRepository
io.ocfl.core.DefaultMutableOcflRepository
- All Implemented Interfaces:
MutableOcflRepository
,OcflRepository
public class DefaultMutableOcflRepository
extends DefaultOcflRepository
implements MutableOcflRepository
Extends the OCFL repository to support OCFL objects with mutable HEADs as defined by the
Mutable HEAD Extension.
This is not supported in the official spec.
- See Also:
-
Field Summary
Fields inherited from class io.ocfl.core.DefaultOcflRepository
addFileProcessorBuilder, inventoryUpdaterBuilder
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultMutableOcflRepository
(OcflStorage storage, Path workDir, ObjectLock objectLock, InventoryMapper inventoryMapper, LogicalPathMapper logicalPathMapper, ContentPathConstraintProcessor contentPathConstraintProcessor, OcflConfig config, boolean verifyStaging, Duration fileLockTimeoutDuration) -
Method Summary
Modifier and TypeMethodDescriptioncommitStagedChanges
(String objectId, VersionInfo versionInfo) boolean
hasStagedChanges
(String objectId) void
purgeStagedChanges
(String objectId) stageChanges
(ObjectVersionId objectVersionId, VersionInfo versionInfo, Consumer<OcflObjectUpdater> objectUpdater) Methods inherited from class io.ocfl.core.DefaultOcflRepository
buildNewInventory, close, config, containsObject, createStagingDir, createStubInventory, describeObject, describeVersion, enforceObjectVersionForUpdate, ensureOpen, exportObject, exportVersion, fileChangeHistory, getObject, getObject, importObject, importVersion, invalidateCache, invalidateCache, listObjectIds, loadInventory, now, purgeObject, putObject, replicateVersionAsHead, requireInventory, resolveContentDir, rollbackToVersion, setClock, updateObject, validateObject, validateVersionInfo, writeInventory, writeNewVersion
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.ocfl.api.OcflRepository
close, config, containsObject, describeObject, describeVersion, exportObject, exportVersion, fileChangeHistory, getObject, getObject, importObject, importVersion, invalidateCache, invalidateCache, listObjectIds, purgeObject, putObject, replicateVersionAsHead, rollbackToVersion, updateObject, validateObject
-
Constructor Details
-
DefaultMutableOcflRepository
public DefaultMutableOcflRepository(OcflStorage storage, Path workDir, ObjectLock objectLock, InventoryMapper inventoryMapper, LogicalPathMapper logicalPathMapper, ContentPathConstraintProcessor contentPathConstraintProcessor, OcflConfig config, boolean verifyStaging, Duration fileLockTimeoutDuration) - Parameters:
storage
- storage layerworkDir
- path to the directory to use for assembling ocfl versionsobjectLock
- locking clientinventoryMapper
- object mapper for serializing inventorieslogicalPathMapper
- logical path mappercontentPathConstraintProcessor
- content path constraint processorconfig
- ocfl defaults configurationverifyStaging
- true if the contents of a stage version should be double-checkedfileLockTimeoutDuration
- the max amount of time to wait for a file lock- See Also:
-
-
Method Details
-
stageChanges
public ObjectVersionId stageChanges(ObjectVersionId objectVersionId, VersionInfo versionInfo, Consumer<OcflObjectUpdater> objectUpdater) - Specified by:
stageChanges
in interfaceMutableOcflRepository
-
commitStagedChanges
- Specified by:
commitStagedChanges
in interfaceMutableOcflRepository
-
purgeStagedChanges
- Specified by:
purgeStagedChanges
in interfaceMutableOcflRepository
-
hasStagedChanges
- Specified by:
hasStagedChanges
in interfaceMutableOcflRepository
-