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:
OcflRepositoryBuilder
-
-
Field Summary
-
Fields inherited from class io.ocfl.core.DefaultOcflRepository
addFileProcessorBuilder, inventoryUpdaterBuilder
-
-
Constructor Summary
Constructors Constructor Description DefaultMutableOcflRepository(OcflStorage storage, Path workDir, ObjectLock objectLock, InventoryMapper inventoryMapper, LogicalPathMapper logicalPathMapper, ContentPathConstraintProcessor contentPathConstraintProcessor, OcflConfig config, boolean verifyStaging, Duration fileLockTimeoutDuration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectVersionId
commitStagedChanges(String objectId, VersionInfo versionInfo)
boolean
hasStagedChanges(String objectId)
void
purgeStagedChanges(String objectId)
ObjectVersionId
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 Detail
-
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:
OcflRepositoryBuilder
-
-
Method Detail
-
stageChanges
public ObjectVersionId stageChanges(ObjectVersionId objectVersionId, VersionInfo versionInfo, Consumer<OcflObjectUpdater> objectUpdater)
- Specified by:
stageChanges
in interfaceMutableOcflRepository
-
commitStagedChanges
public ObjectVersionId commitStagedChanges(String objectId, VersionInfo versionInfo)
- Specified by:
commitStagedChanges
in interfaceMutableOcflRepository
-
purgeStagedChanges
public void purgeStagedChanges(String objectId)
- Specified by:
purgeStagedChanges
in interfaceMutableOcflRepository
-
hasStagedChanges
public boolean hasStagedChanges(String objectId)
- Specified by:
hasStagedChanges
in interfaceMutableOcflRepository
-
-