Class MembershipIndexManager

java.lang.Object
org.fcrepo.kernel.impl.services.MembershipIndexManager

@Component public class MembershipIndexManager extends Object
Manager for the membership index
Author:
bbpennel
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addMembership(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, org.fcrepo.kernel.api.identifiers.FedoraId proxyId, org.apache.jena.graph.Triple membership, Instant startTime)
    Add new membership property to the index, clearing any delete operations for the property if necessary.
    void
    addMembership(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, org.fcrepo.kernel.api.identifiers.FedoraId proxyId, org.apache.jena.graph.Triple membership, Instant startTime, Instant endTime)
    Add new membership property to the index
    void
     
    void
    Clear all entries from the index
    void
    commitTransaction(org.fcrepo.kernel.api.Transaction tx)
    Perform a commit of operations stored in the specified transaction
    void
    deleteMembershipForProxyAfter(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, org.fcrepo.kernel.api.identifiers.FedoraId proxyId, Instant afterTime)
     
    void
    deleteMembershipForSourceAfter(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, Instant afterTime)
    Delete membership entries that are active at or after the given timestamp for the specified source
    void
    deleteMembershipReferences(String txId, org.fcrepo.kernel.api.identifiers.FedoraId targetId)
    Clean up any references to the target id, in transactions and outside
    void
    deleteTransaction(org.fcrepo.kernel.api.Transaction tx)
    Delete all entries related to a transaction
    void
    endMembershipForSource(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, Instant endTime)
    End all membership properties resulting from the specified source container
    void
    endMembershipFromChild(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, org.fcrepo.kernel.api.identifiers.FedoraId proxyId, Instant endTime)
    End a membership from the child of a Direct/IndirectContainer, setting an end time if committed, or clearing from the current tx if it was newly added.
    Get the JDBC datastore.
    getLastUpdated(org.fcrepo.kernel.api.Transaction transaction, org.fcrepo.kernel.api.identifiers.FedoraId subjectId)
     
    Stream<org.apache.jena.graph.Triple>
    getMembership(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId subjectId)
    Get a stream of membership triples with
    protected void
    Log all membership entries, for debugging usage only
    protected void
    Log all membership operations, for debugging usage only
    void
    Set the JDBC datastore.
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • setUp

      @PostConstruct public void setUp()
    • endMembershipFromChild

      public void endMembershipFromChild(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, org.fcrepo.kernel.api.identifiers.FedoraId proxyId, Instant endTime)
      End a membership from the child of a Direct/IndirectContainer, setting an end time if committed, or clearing from the current tx if it was newly added.
      Parameters:
      tx - transaction
      sourceId - ID of the direct/indirect container whose membership should be ended
      proxyId - ID of the proxy producing this membership, when applicable
      endTime - the time the resource was deleted, generally its last modified
    • deleteMembershipForProxyAfter

      public void deleteMembershipForProxyAfter(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, org.fcrepo.kernel.api.identifiers.FedoraId proxyId, Instant afterTime)
    • endMembershipForSource

      public void endMembershipForSource(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, Instant endTime)
      End all membership properties resulting from the specified source container
      Parameters:
      tx - transaction
      sourceId - ID of the direct/indirect container whose membership should be ended
      endTime - the time the resource was deleted, generally its last modified
    • deleteMembershipForSourceAfter

      public void deleteMembershipForSourceAfter(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, Instant afterTime)
      Delete membership entries that are active at or after the given timestamp for the specified source
      Parameters:
      tx - transaction
      sourceId - ID of the direct/indirect container
      afterTime - time at or after which membership should be removed
    • deleteMembershipReferences

      public void deleteMembershipReferences(String txId, org.fcrepo.kernel.api.identifiers.FedoraId targetId)
      Clean up any references to the target id, in transactions and outside
      Parameters:
      txId - transaction id
      targetId - identifier of the resource to cleanup membership references for
    • addMembership

      public void addMembership(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, org.fcrepo.kernel.api.identifiers.FedoraId proxyId, org.apache.jena.graph.Triple membership, Instant startTime)
      Add new membership property to the index, clearing any delete operations for the property if necessary.
      Parameters:
      tx - transaction
      sourceId - ID of the direct/indirect container which produced the membership
      proxyId - ID of the proxy producing this membership, when applicable
      membership - membership triple
      startTime - time the membership triple was added
    • addMembership

      public void addMembership(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, org.fcrepo.kernel.api.identifiers.FedoraId proxyId, org.apache.jena.graph.Triple membership, Instant startTime, Instant endTime)
      Add new membership property to the index
      Parameters:
      tx - transaction
      sourceId - ID of the direct/indirect container which produced the membership
      proxyId - ID of the proxy producing this membership, when applicable
      membership - membership triple
      startTime - time the membership triple was added
      endTime - time the membership triple ends, or never if not provided
    • getMembership

      public Stream<org.apache.jena.graph.Triple> getMembership(org.fcrepo.kernel.api.Transaction tx, org.fcrepo.kernel.api.identifiers.FedoraId subjectId)
      Get a stream of membership triples with
      Parameters:
      tx - transaction from which membership will be retrieved, or null for no transaction
      subjectId - ID of the subject
      Returns:
      Stream of membership triples
    • getLastUpdated

      public Instant getLastUpdated(org.fcrepo.kernel.api.Transaction transaction, org.fcrepo.kernel.api.identifiers.FedoraId subjectId)
    • commitTransaction

      public void commitTransaction(org.fcrepo.kernel.api.Transaction tx)
      Perform a commit of operations stored in the specified transaction
      Parameters:
      tx - transaction
    • deleteTransaction

      @Transactional(propagation=NOT_SUPPORTED) public void deleteTransaction(org.fcrepo.kernel.api.Transaction tx)
      Delete all entries related to a transaction
      Parameters:
      tx - transaction
    • clearIndex

      public void clearIndex()
      Clear all entries from the index
    • clearAllTransactions

      public void clearAllTransactions()
    • logMembership

      protected void logMembership()
      Log all membership entries, for debugging usage only
    • logOperations

      protected void logOperations()
      Log all membership operations, for debugging usage only
    • setDataSource

      public void setDataSource(DataSource dataSource)
      Set the JDBC datastore.
      Parameters:
      dataSource - the dataStore.
    • getDataSource

      Get the JDBC datastore.
      Returns:
      the dataStore.