Class DbFedoraToOcflObjectIndex

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      FedoraOcflMapping addMapping​(org.fcrepo.kernel.api.Transaction transaction, org.fcrepo.kernel.api.identifiers.FedoraId fedoraId, org.fcrepo.kernel.api.identifiers.FedoraId fedoraRootId, String ocflId)
      Adds a mapping to the index
      void clearAllTransactions()
      Clear all transactions in the ocfl index.
      void commit​(org.fcrepo.kernel.api.Transaction transaction)
      Commit mapping changes for the session.
      FedoraOcflMapping getMapping​(org.fcrepo.kernel.api.Transaction transaction, org.fcrepo.kernel.api.identifiers.FedoraId fedoraId)
      Retrieve identification information for the OCFL object which either contains, or is identified by, the provided fedora resource id.
      void removeMapping​(org.fcrepo.kernel.api.Transaction transaction, org.fcrepo.kernel.api.identifiers.FedoraId fedoraId)
      Removes a mapping
      void reset()
      Remove all persistent state associated with the index.
      void rollback​(org.fcrepo.kernel.api.Transaction transaction)
      Rollback mapping changes for the session.
      void setup()  
    • Method Detail

      • setup

        @PostConstruct
        public void setup()
      • getMapping

        public FedoraOcflMapping getMapping​(org.fcrepo.kernel.api.Transaction transaction,
                                            org.fcrepo.kernel.api.identifiers.FedoraId fedoraId)
                                     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 interface FedoraToOcflObjectIndex
        Parameters:
        transaction - the current session, or null for read-only.
        fedoraId - the fedora resource identifier
        Returns:
        the mapping
        Throws:
        FedoraOcflMappingNotFoundException - when no mapping exists for the specified identifier.
      • addMapping

        public FedoraOcflMapping addMapping​(@Nonnull
                                            org.fcrepo.kernel.api.Transaction transaction,
                                            org.fcrepo.kernel.api.identifiers.FedoraId fedoraId,
                                            org.fcrepo.kernel.api.identifiers.FedoraId fedoraRootId,
                                            String ocflId)
        Description copied from interface: FedoraToOcflObjectIndex
        Adds a mapping to the index
        Specified by:
        addMapping in interface FedoraToOcflObjectIndex
        Parameters:
        transaction - the current session.
        fedoraId - The fedora resource
        fedoraRootId - The identifier of the root fedora object resource
        ocflId - The ocfl object id
        Returns:
        The newly created mapping
      • removeMapping

        public void removeMapping​(@Nonnull
                                  org.fcrepo.kernel.api.Transaction transaction,
                                  org.fcrepo.kernel.api.identifiers.FedoraId fedoraId)
        Description copied from interface: FedoraToOcflObjectIndex
        Removes a mapping
        Specified by:
        removeMapping in interface FedoraToOcflObjectIndex
        Parameters:
        transaction - the current session.
        fedoraId - The fedora resource to remove the mapping for
      • commit

        public void commit​(@Nonnull
                           org.fcrepo.kernel.api.Transaction transaction)
        Description copied from interface: FedoraToOcflObjectIndex
        Commit mapping changes for the session.
        Specified by:
        commit in interface FedoraToOcflObjectIndex
        Parameters:
        transaction - the session to commit.
      • rollback

        @Transactional(propagation=NOT_SUPPORTED)
        public void rollback​(@Nonnull
                             org.fcrepo.kernel.api.Transaction transaction)
        Description copied from interface: FedoraToOcflObjectIndex
        Rollback mapping changes for the session.
        Specified by:
        rollback in interface FedoraToOcflObjectIndex
        Parameters:
        transaction - the session to rollback.