Package org.fcrepo.kernel.impl.services
Class MembershipServiceImpl
- java.lang.Object
-
- org.fcrepo.kernel.impl.services.MembershipServiceImpl
-
- All Implemented Interfaces:
MembershipService
@Component public class MembershipServiceImpl extends Object implements MembershipService
Implementation of a service which updates and persists membership properties for resources- Since:
- 6.0.0
- Author:
- bbpennel
-
-
Field Summary
Fields Modifier and Type Field Description static Instant
NO_END_INSTANT
-
Constructor Summary
Constructors Constructor Description MembershipServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
commitTransaction(Transaction tx)
Commit any pending membership changes.Instant
getLastUpdatedTimestamp(Transaction transaction, FedoraId fedoraId)
Get the timestamp of the most recent member added or removed, or null if none.RdfStream
getMembership(Transaction tx, FedoraId fedoraId)
Return an RdfStream of membership relations of which the provided resource is the subject.void
populateMembershipHistory(Transaction transaction, FedoraId containerId)
Regenerate the membership history for specified Direct or Indirect container.void
reset()
Truncates the membership index.void
resourceCreated(Transaction tx, FedoraId fedoraId)
Update membership properties based on the creation of the specified resourcevoid
resourceDeleted(Transaction transaction, FedoraId fedoraId)
Update membership properties based on the deletion of the specified resourcevoid
resourceModified(Transaction tx, FedoraId fedoraId)
Update membership properties based on the modification of the specified resourcevoid
rollbackTransaction(Transaction tx)
Rollback any pending membership changes.void
setMembershipIndexManager(MembershipIndexManager indexManager)
void
setResourceFactory(ResourceFactory resourceFactory)
-
-
-
Field Detail
-
NO_END_INSTANT
public static final Instant NO_END_INSTANT
-
-
Constructor Detail
-
MembershipServiceImpl
public MembershipServiceImpl()
-
-
Method Detail
-
resourceCreated
public void resourceCreated(Transaction tx, FedoraId fedoraId)
Description copied from interface:MembershipService
Update membership properties based on the creation of the specified resource- Specified by:
resourceCreated
in interfaceMembershipService
- Parameters:
tx
- transactionfedoraId
- ID of the object created
-
resourceModified
public void resourceModified(Transaction tx, FedoraId fedoraId)
Description copied from interface:MembershipService
Update membership properties based on the modification of the specified resource- Specified by:
resourceModified
in interfaceMembershipService
- Parameters:
tx
- transactionfedoraId
- ID of the object modified
-
resourceDeleted
public void resourceDeleted(@Nonnull Transaction transaction, FedoraId fedoraId)
Description copied from interface:MembershipService
Update membership properties based on the deletion of the specified resource- Specified by:
resourceDeleted
in interfaceMembershipService
- Parameters:
transaction
- transactionfedoraId
- ID of the object deleted
-
getMembership
public RdfStream getMembership(Transaction tx, FedoraId fedoraId)
Description copied from interface:MembershipService
Return an RdfStream of membership relations of which the provided resource is the subject.- Specified by:
getMembership
in interfaceMembershipService
- Parameters:
tx
- transactionfedoraId
- the resource to get membership relations for.- Returns:
- RdfStream of membership relations.
-
commitTransaction
public void commitTransaction(Transaction tx)
Description copied from interface:MembershipService
Commit any pending membership changes.- Specified by:
commitTransaction
in interfaceMembershipService
- Parameters:
tx
- the transaction
-
rollbackTransaction
public void rollbackTransaction(Transaction tx)
Description copied from interface:MembershipService
Rollback any pending membership changes.- Specified by:
rollbackTransaction
in interfaceMembershipService
- Parameters:
tx
- the transaction
-
reset
public void reset()
Description copied from interface:MembershipService
Truncates the membership index. This should only be called when rebuilding the index.- Specified by:
reset
in interfaceMembershipService
-
populateMembershipHistory
public void populateMembershipHistory(@Nonnull Transaction transaction, FedoraId containerId)
Description copied from interface:MembershipService
Regenerate the membership history for specified Direct or Indirect container.- Specified by:
populateMembershipHistory
in interfaceMembershipService
- Parameters:
transaction
- transactioncontainerId
- ID of the container
-
getLastUpdatedTimestamp
public Instant getLastUpdatedTimestamp(Transaction transaction, FedoraId fedoraId)
Description copied from interface:MembershipService
Get the timestamp of the most recent member added or removed, or null if none.- Specified by:
getLastUpdatedTimestamp
in interfaceMembershipService
- Parameters:
transaction
- transaction or null if nonefedoraId
- the resource id- Returns:
- the timestamp or null
-
setMembershipIndexManager
public void setMembershipIndexManager(MembershipIndexManager indexManager)
- Parameters:
indexManager
- the indexManager to set
-
setResourceFactory
public void setResourceFactory(ResourceFactory resourceFactory)
- Parameters:
resourceFactory
- the resourceFactory to set
-
-