Package org.fcrepo.persistence.ocfl.api
Interface FedoraToOcflObjectIndex
-
- All Known Implementing Classes:
DbFedoraToOcflObjectIndex
,FedoraToOcflObjectIndexMetrics
public interface FedoraToOcflObjectIndex
- Since:
- 6.0.0
- Author:
- dbernstein
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FedoraOcflMapping
addMapping(Transaction session, FedoraId fedoraResourceIdentifier, FedoraId fedoraRootObjectIdentifier, String ocflObjectId)
Adds a mapping to the indexvoid
commit(Transaction session)
Commit mapping changes for the session.FedoraOcflMapping
getMapping(Transaction session, FedoraId fedoraResourceIdentifier)
Retrieve identification information for the OCFL object which either contains, or is identified by, the provided fedora resource id.void
removeMapping(Transaction session, FedoraId fedoraResourceIdentifier)
Removes a mappingvoid
reset()
Remove all persistent state associated with the index.void
rollback(Transaction session)
Rollback mapping changes for the session.
-
-
-
Method Detail
-
getMapping
FedoraOcflMapping getMapping(Transaction session, FedoraId fedoraResourceIdentifier) throws FedoraOcflMappingNotFoundException
Retrieve identification information for the OCFL object which either contains, or is identified by, the provided fedora resource id. In other words the method will find the closest resource that is persisted as an OCFL object and returns its identifiers. If you pass fedora identifier that is not part of an archival group such as "my/fedora/binary/fcr:metadata" the fedora resource returned in the mapping will be "my/fedora/binary". Contrast this with an Archival Group example: if you pass in "my/archival-group/binary/fcr:metadata" the resource returned in the mapping would be "my/archival-group".- Parameters:
session
- the current session, or null for read-only.fedoraResourceIdentifier
- the fedora resource identifier- Returns:
- the mapping
- Throws:
FedoraOcflMappingNotFoundException
- when no mapping exists for the specified identifier.
-
addMapping
FedoraOcflMapping addMapping(@Nonnull Transaction session, FedoraId fedoraResourceIdentifier, FedoraId fedoraRootObjectIdentifier, String ocflObjectId)
Adds a mapping to the index- Parameters:
session
- the current session.fedoraResourceIdentifier
- The fedora resourcefedoraRootObjectIdentifier
- The identifier of the root fedora object resourceocflObjectId
- The ocfl object id- Returns:
- The newly created mapping
-
removeMapping
void removeMapping(@Nonnull Transaction session, FedoraId fedoraResourceIdentifier)
Removes a mapping- Parameters:
session
- the current session.fedoraResourceIdentifier
- The fedora resource to remove the mapping for
-
reset
void reset()
Remove all persistent state associated with the index.
-
commit
void commit(@Nonnull Transaction session)
Commit mapping changes for the session.- Parameters:
session
- the session to commit.
-
rollback
void rollback(@Nonnull Transaction session)
Rollback mapping changes for the session.- Parameters:
session
- the session to rollback.
-
-