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 FedoraToOcflObjectIndex
Wrapper 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 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.
-
-
-
Constructor Detail
-
FedoraToOcflObjectIndexMetrics
public FedoraToOcflObjectIndexMetrics()
-
-
Method Detail
-
getMapping
public FedoraOcflMapping getMapping(Transaction session, FedoraId fedoraResourceIdentifier) throws FedoraOcflMappingNotFoundException
Description copied from interface:FedoraToOcflObjectIndex
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".- Specified by:
getMapping
in 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(Transaction session, FedoraId fedoraResourceIdentifier, FedoraId fedoraRootObjectIdentifier, String ocflObjectId)
Description copied from interface:FedoraToOcflObjectIndex
Adds a mapping to the index- Specified by:
addMapping
in 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(Transaction session, FedoraId fedoraResourceIdentifier)
Description copied from interface:FedoraToOcflObjectIndex
Removes a mapping- Specified by:
removeMapping
in interfaceFedoraToOcflObjectIndex
- Parameters:
session
- the current session.fedoraResourceIdentifier
- The fedora resource to remove the mapping for
-
reset
public void reset()
Description copied from interface:FedoraToOcflObjectIndex
Remove all persistent state associated with the index.- Specified by:
reset
in interfaceFedoraToOcflObjectIndex
-
commit
public void commit(Transaction session)
Description copied from interface:FedoraToOcflObjectIndex
Commit mapping changes for the session.- Specified by:
commit
in interfaceFedoraToOcflObjectIndex
- Parameters:
session
- the session to commit.
-
rollback
public void rollback(Transaction session)
Description copied from interface:FedoraToOcflObjectIndex
Rollback mapping changes for the session.- Specified by:
rollback
in interfaceFedoraToOcflObjectIndex
- Parameters:
session
- the session to rollback.
-
-