Package org.fcrepo.kernel.impl.services
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 MembershipIndexManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddMembership(String txId, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, org.apache.jena.graph.Triple membership, Instant startTime)Add new membership property to the index, clearing any delete operations for the property if necessary.voidaddMembership(String txId, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, org.apache.jena.graph.Triple membership, Instant startTime, Instant endTime)Add new membership property to the indexvoidclearIndex()Clear all entries from the indexvoidcommitTransaction(String txId)Perform a commit of operations stored in the specified transactionvoiddeleteMembershipForSourceAfter(String txId, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, Instant afterTime)Delete membership entries that are active at or after the given timestamp for the specified sourcevoiddeleteMembershipReferences(String txId, org.fcrepo.kernel.api.identifiers.FedoraId targetId)Clean up any references to the target id, in transactions and outsidevoiddeleteTransaction(String txId)Delete all entries related to a transactionvoidendMembership(String txId, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, org.apache.jena.graph.Triple membership, Instant endTime)End a membership entry, setting an end time if committed, or clearing from the current tx if it was newly added.voidendMembershipForSource(String txId, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, Instant endTime)End all membership properties resulting from the specified source containerDataSourcegetDataSource()Get the JDBC datastore.Stream<org.apache.jena.graph.Triple>getMembership(String txId, org.fcrepo.kernel.api.identifiers.FedoraId subjectId)Get a stream of membership triples withvoidlogMembership()Log all membership entries, for debugging usage onlyvoidlogOperations()Log all membership operations, for debugging usage onlyvoidsetDataSource(DataSource dataSource)Set the JDBC datastore.voidsetUp()
-
-
-
Constructor Detail
-
MembershipIndexManager
public MembershipIndexManager()
-
-
Method Detail
-
setUp
@PostConstruct public void setUp()
-
endMembership
public void endMembership(String txId, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, org.apache.jena.graph.Triple membership, Instant endTime)
End a membership entry, setting an end time if committed, or clearing from the current tx if it was newly added.- Parameters:
txId- transaction idsourceId- ID of the direct/indirect container whose membership should be endedmembership- membership triple to endendTime- the time the resource was deleted, generally its last modified
-
endMembershipForSource
public void endMembershipForSource(String txId, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, Instant endTime)
End all membership properties resulting from the specified source container- Parameters:
txId- transaction idsourceId- ID of the direct/indirect container whose membership should be endedendTime- the time the resource was deleted, generally its last modified
-
deleteMembershipForSourceAfter
public void deleteMembershipForSourceAfter(String txId, 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:
txId- transaction idsourceId- ID of the direct/indirect containerafterTime- 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 idtargetId- identifier of the resource to cleanup membership references for
-
addMembership
public void addMembership(String txId, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, 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:
txId- transaction idsourceId- ID of the direct/indirect container which produced the membershipmembership- membership triplestartTime- time the membership triple was added
-
addMembership
public void addMembership(String txId, org.fcrepo.kernel.api.identifiers.FedoraId sourceId, org.apache.jena.graph.Triple membership, Instant startTime, Instant endTime)
Add new membership property to the index- Parameters:
txId- transaction idsourceId- ID of the direct/indirect container which produced the membershipmembership- membership triplestartTime- time the membership triple was addedendTime- time the membership triple ends, or never if not provided
-
getMembership
public Stream<org.apache.jena.graph.Triple> getMembership(String txId, org.fcrepo.kernel.api.identifiers.FedoraId subjectId)
Get a stream of membership triples with- Parameters:
txId- transaction from which membership will be retrieved, or null for no transactionsubjectId- ID of the subject- Returns:
- Stream of membership triples
-
commitTransaction
public void commitTransaction(String txId)
Perform a commit of operations stored in the specified transaction- Parameters:
txId- transaction id
-
deleteTransaction
public void deleteTransaction(String txId)
Delete all entries related to a transaction- Parameters:
txId- transaction id
-
clearIndex
public void clearIndex()
Clear all entries from the index
-
logMembership
public void logMembership()
Log all membership entries, for debugging usage only
-
logOperations
public 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
public DataSource getDataSource()
Get the JDBC datastore.- Returns:
- the dataStore.
-
-