Class NuxeoDriveGroupUpdateListener
- java.lang.Object
-
- org.nuxeo.drive.listener.NuxeoDriveGroupUpdateListener
-
- All Implemented Interfaces:
PostCommitEventListener,PostCommitFilteringEventListener
public class NuxeoDriveGroupUpdateListener extends Object implements PostCommitFilteringEventListener
Post-commit asynchronous listener that handles group change events fired by theUserManager.For all the documents carrying an ACL impacted by a changed group or one of its ancestors it fires the
NuxeoDriveEvents.GROUP_UPDATEDevent that is handled by the synchronousNuxeoDriveFileSystemDeletionListener.- Since:
- 9.2
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.apache.logging.log4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description NuxeoDriveGroupUpdateListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanacceptEvent(Event event)Checks if this event is worth passing to the asynchronousPostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle).protected List<String>getAllGroupNames(String groupName, EventContext context)Returns a list containing the names of the given group and all its ancestor groups.protected StringgetGroupName(EventContext context)protected StringgetImpactedDocumentQuery(List<String> groupNames)Returns a query listing the documents carrying an ACL impacted by one of the given group names.voidhandleEvent(EventBundle events)Handles the set of events that were raised during the life of an user operation.protected voidhandleUpdatedGroups(List<String> groupNames)
-
-
-
Method Detail
-
acceptEvent
public boolean acceptEvent(Event event)
Description copied from interface:PostCommitFilteringEventListenerChecks if this event is worth passing to the asynchronousPostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle).Note that the event's documents are usually disconnected into
ShallowDocumentModelinstances, which means that this method may not be able to get to all the information it would get from a standard DocumentModel implementation. If there is not enough information in the ShallowDocumentModel to decide whether this event is of interest, then this method should accept it an let the actual logic done inPostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle)do the final filtering.- Specified by:
acceptEventin interfacePostCommitFilteringEventListener- Parameters:
event- the event- Returns:
trueto accept it, orfalseto ignore it
-
handleEvent
public void handleEvent(EventBundle events)
Description copied from interface:PostCommitEventListenerHandles the set of events that were raised during the life of an user operation.The events are fired as a
BundleEventafter the transaction is committed.- Specified by:
handleEventin interfacePostCommitEventListener- Parameters:
events- the events to handle
-
getGroupName
protected String getGroupName(EventContext context)
-
getAllGroupNames
protected List<String> getAllGroupNames(String groupName, EventContext context)
Returns a list containing the names of the given group and all its ancestor groups.
-
-