Package org.fcrepo.persistence.ocfl.impl
Class UpdateNonRdfSourceHeadersPersister
- java.lang.Object
-
- org.fcrepo.persistence.ocfl.impl.UpdateNonRdfSourceHeadersPersister
-
- All Implemented Interfaces:
Persister
public class UpdateNonRdfSourceHeadersPersister extends Object
This class implements the persistence of the headers for an RDFSource to bring in new system managed properties- Since:
- 6.0.0
- Author:
- mikejritter
-
-
Field Summary
Fields Modifier and Type Field Description protected FedoraToOcflObjectIndex
ocflIndex
-
Constructor Summary
Constructors Constructor Description UpdateNonRdfSourceHeadersPersister(FedoraToOcflObjectIndex fedoraOcflIndex)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ResourceHeadersImpl
createCommonHeaders(org.fcrepo.storage.ocfl.OcflObjectSession session, ResourceOperation operation, boolean isResourceRoot, FedoraId archivalGroupId)
protected Optional<FedoraId>
findArchivalGroupInAncestry(FedoraId fedoraId, OcflPersistentStorageSession session)
protected FedoraOcflMapping
getMapping(Transaction transaction, FedoraId resourceId)
boolean
handle(ResourceOperation operation)
The method returns true if the operation can be persisted by this persister.protected String
mapToOcflId(Transaction transaction, FedoraId fedoraId)
Maps the Fedora ID to an OCFL ID.void
persist(OcflPersistentStorageSession session, ResourceOperation operation)
The persistence handling for the given operation.protected void
persistRDF(org.fcrepo.storage.ocfl.OcflObjectSession objectSession, ResourceOperation operation, FedoraId rootId, boolean isArchivalPart)
Persists the RDF using the specified operation and session.
-
-
-
Field Detail
-
ocflIndex
protected final FedoraToOcflObjectIndex ocflIndex
-
-
Constructor Detail
-
UpdateNonRdfSourceHeadersPersister
public UpdateNonRdfSourceHeadersPersister(FedoraToOcflObjectIndex fedoraOcflIndex)
Constructor- Parameters:
fedoraOcflIndex
- the FedoraToOcflObjectIndex
-
-
Method Detail
-
persist
public void persist(OcflPersistentStorageSession session, ResourceOperation operation) throws PersistentStorageException
Description copied from interface:Persister
The persistence handling for the given operation.- Parameters:
session
- The persistent storage sessionoperation
- The operation and associated data need to perform the operation.- Throws:
PersistentStorageException
- on failure
-
persistRDF
protected void persistRDF(org.fcrepo.storage.ocfl.OcflObjectSession objectSession, ResourceOperation operation, FedoraId rootId, boolean isArchivalPart) throws PersistentStorageException
Persists the RDF using the specified operation and session.- Parameters:
objectSession
- The object session.operation
- The operationrootId
- The fedora root object identifier tha maps to the OCFL object root.isArchivalPart
- indicates if the resource is an AG part resource, ignored on update- Throws:
PersistentStorageException
-
handle
public boolean handle(ResourceOperation operation)
Description copied from interface:Persister
The method returns true if the operation can be persisted by this persister.
-
getMapping
protected FedoraOcflMapping getMapping(Transaction transaction, FedoraId resourceId) throws PersistentStorageException
- Parameters:
transaction
- The externally generated transaction.resourceId
- The fedora resource identifier- Returns:
- The associated mapping
- Throws:
PersistentStorageException
- When no mapping is found.
-
findArchivalGroupInAncestry
protected Optional<FedoraId> findArchivalGroupInAncestry(FedoraId fedoraId, OcflPersistentStorageSession session)
-
mapToOcflId
protected String mapToOcflId(Transaction transaction, FedoraId fedoraId)
Maps the Fedora ID to an OCFL ID.- Parameters:
transaction
- The externally generated transaction.fedoraId
- The fedora identifier for the root OCFL object- Returns:
- The OCFL ID
-
createCommonHeaders
protected ResourceHeadersImpl createCommonHeaders(org.fcrepo.storage.ocfl.OcflObjectSession session, ResourceOperation operation, boolean isResourceRoot, FedoraId archivalGroupId) throws PersistentStorageException
- Throws:
PersistentStorageException
-
-