Package org.fcrepo.persistence.ocfl.impl
Class FedoraToOcflObjectIndexMetrics
- java.lang.Object
-
- org.fcrepo.persistence.ocfl.impl.FedoraToOcflObjectIndexMetrics
-
- All Implemented Interfaces:
FedoraToOcflObjectIndex
@Component("ocflIndex") public class FedoraToOcflObjectIndexMetrics extends Object implements FedoraToOcflObjectIndexWrapper for FedoraToOcflObjectIndex that adds metrics- Author:
- pwinckles
-
-
Constructor Summary
Constructors Constructor Description FedoraToOcflObjectIndexMetrics()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FedoraOcflMappingaddMapping(org.fcrepo.kernel.api.Transaction session, org.fcrepo.kernel.api.identifiers.FedoraId fedoraResourceIdentifier, org.fcrepo.kernel.api.identifiers.FedoraId fedoraRootObjectIdentifier, String ocflObjectId)Adds a mapping to the indexvoidclearAllTransactions()Clear all transactions in the ocfl index.voidcommit(org.fcrepo.kernel.api.Transaction session)Commit mapping changes for the session.FedoraOcflMappinggetMapping(org.fcrepo.kernel.api.Transaction session, org.fcrepo.kernel.api.identifiers.FedoraId fedoraResourceIdentifier)Retrieve identification information for the OCFL object which either contains, or is identified by, the provided fedora resource id.voidremoveMapping(org.fcrepo.kernel.api.Transaction session, org.fcrepo.kernel.api.identifiers.FedoraId fedoraResourceIdentifier)Removes a mappingvoidreset()Remove all persistent state associated with the index.voidrollback(org.fcrepo.kernel.api.Transaction session)Rollback mapping changes for the session.
-
-
-
Constructor Detail
-
FedoraToOcflObjectIndexMetrics
public FedoraToOcflObjectIndexMetrics()
-
-
Method Detail
-
getMapping
public FedoraOcflMapping getMapping(org.fcrepo.kernel.api.Transaction session, org.fcrepo.kernel.api.identifiers.FedoraId fedoraResourceIdentifier) throws FedoraOcflMappingNotFoundException
Description copied from interface:FedoraToOcflObjectIndexRetrieve 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".- Specified by:
getMappingin interfaceFedoraToOcflObjectIndex- 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
public FedoraOcflMapping addMapping(org.fcrepo.kernel.api.Transaction session, org.fcrepo.kernel.api.identifiers.FedoraId fedoraResourceIdentifier, org.fcrepo.kernel.api.identifiers.FedoraId fedoraRootObjectIdentifier, String ocflObjectId)
Description copied from interface:FedoraToOcflObjectIndexAdds a mapping to the index- Specified by:
addMappingin interfaceFedoraToOcflObjectIndex- 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
public void removeMapping(org.fcrepo.kernel.api.Transaction session, org.fcrepo.kernel.api.identifiers.FedoraId fedoraResourceIdentifier)
Description copied from interface:FedoraToOcflObjectIndexRemoves a mapping- Specified by:
removeMappingin interfaceFedoraToOcflObjectIndex- Parameters:
session- the current session.fedoraResourceIdentifier- The fedora resource to remove the mapping for
-
reset
public void reset()
Description copied from interface:FedoraToOcflObjectIndexRemove all persistent state associated with the index.- Specified by:
resetin interfaceFedoraToOcflObjectIndex
-
commit
public void commit(org.fcrepo.kernel.api.Transaction session)
Description copied from interface:FedoraToOcflObjectIndexCommit mapping changes for the session.- Specified by:
commitin interfaceFedoraToOcflObjectIndex- Parameters:
session- the session to commit.
-
rollback
public void rollback(org.fcrepo.kernel.api.Transaction session)
Description copied from interface:FedoraToOcflObjectIndexRollback mapping changes for the session.- Specified by:
rollbackin interfaceFedoraToOcflObjectIndex- Parameters:
session- the session to rollback.
-
clearAllTransactions
public void clearAllTransactions()
Description copied from interface:FedoraToOcflObjectIndexClear all transactions in the ocfl index.- Specified by:
clearAllTransactionsin interfaceFedoraToOcflObjectIndex
-
-