Class MembershipIndexManager

    • Method Detail

      • setUp

        @PostConstruct
        public void setUp()
      • endMembershipFromChild

        public void endMembershipFromChild​(Transaction tx,
                                           FedoraId sourceId,
                                           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
      • endMembershipForSource

        public void endMembershipForSource​(Transaction tx,
                                           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​(Transaction tx,
                                                   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,
                                               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​(Transaction tx,
                                  FedoraId sourceId,
                                  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​(Transaction tx,
                                  FedoraId sourceId,
                                  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​(Transaction tx,
                                                                  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
      • commitTransaction

        public void commitTransaction​(Transaction tx)
        Perform a commit of operations stored in the specified transaction
        Parameters:
        tx - transaction
      • deleteTransaction

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

        public void clearIndex()
        Clear all entries from the index
      • 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.