Class CreateVersionPersister

  • All Implemented Interfaces:
    Persister

    public class CreateVersionPersister
    extends Object
    Persister for creating a new OCFL version of a resource. The new version is not created until the session is committed.
    Author:
    pwinckles
    • Method Detail

      • persist

        public void persist​(OcflPersistentStorageSession session,
                            org.fcrepo.kernel.api.operations.ResourceOperation operation)
                     throws org.fcrepo.persistence.api.exceptions.PersistentStorageException
        Description copied from interface: Persister
        The persistence handling for the given operation.
        Parameters:
        session - The persistent storage session
        operation - The operation and associated data need to perform the operation.
        Throws:
        org.fcrepo.persistence.api.exceptions.PersistentStorageException - on failure
      • handle

        public boolean handle​(org.fcrepo.kernel.api.operations.ResourceOperation operation)
        Description copied from interface: Persister
        The method returns true if the operation can be persisted by this persister.
        Specified by:
        handle in interface Persister
        Parameters:
        operation - the operation to persist
        Returns:
        true or false
      • getMapping

        protected FedoraOcflMapping getMapping​(org.fcrepo.kernel.api.Transaction transaction,
                                               org.fcrepo.kernel.api.identifiers.FedoraId resourceId)
                                        throws org.fcrepo.persistence.api.exceptions.PersistentStorageException
        Parameters:
        transaction - The externally generated transaction.
        resourceId - The fedora resource identifier
        Returns:
        The associated mapping
        Throws:
        org.fcrepo.persistence.api.exceptions.PersistentStorageException - When no mapping is found.
      • findArchivalGroupInAncestry

        protected Optional<org.fcrepo.kernel.api.identifiers.FedoraId> findArchivalGroupInAncestry​(org.fcrepo.kernel.api.identifiers.FedoraId fedoraId,
                                                                                                   OcflPersistentStorageSession session)
      • mapToOcflId

        protected String mapToOcflId​(org.fcrepo.kernel.api.Transaction transaction,
                                     org.fcrepo.kernel.api.identifiers.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 org.fcrepo.persistence.common.ResourceHeadersImpl createCommonHeaders​(org.fcrepo.storage.ocfl.OcflObjectSession session,
                                                                                        org.fcrepo.kernel.api.operations.ResourceOperation operation,
                                                                                        boolean isResourceRoot,
                                                                                        org.fcrepo.kernel.api.identifiers.FedoraId archivalGroupId)
                                                                                 throws org.fcrepo.persistence.api.exceptions.PersistentStorageException
        Throws:
        org.fcrepo.persistence.api.exceptions.PersistentStorageException