public class NuxeoDriveGroupUpdateListener extends Object implements PostCommitFilteringEventListener
UserManager
.
For all the documents carrying an ACL impacted by a changed group or one of its ancestors it fires the
NuxeoDriveEvents.GROUP_UPDATED
event that is handled by the synchronous
NuxeoDriveFileSystemDeletionListener
.
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
NuxeoDriveGroupUpdateListener() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptEvent(Event event)
Checks if this event is worth passing to the asynchronous
PostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle) . |
protected void |
fireGroupUpdatedEvent(CoreSession session,
DocumentModel source) |
protected List<String> |
getAllGroupNames(String groupName,
EventContext context)
Returns a list containing the names of the given group and all its ancestor groups.
|
protected DocumentModelList |
getImpactedDocuments(CoreSession session,
List<String> groupNames)
Returns the list of documents carrying an ACL impacted by one of the given group names.
|
void |
handleEvent(EventBundle events)
Handles the set of events that were raised during the life of an user operation.
|
protected void |
handleUpdatedGroups(List<String> groupNames) |
protected static final org.apache.commons.logging.Log log
public NuxeoDriveGroupUpdateListener()
public boolean acceptEvent(Event event)
PostCommitFilteringEventListener
PostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle)
.
Note that the event's documents are usually disconnected into
ShallowDocumentModel
instances, 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 in PostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle)
do the final filtering.
acceptEvent
in interface PostCommitFilteringEventListener
event
- the eventtrue
to accept it, or false
to ignore itpublic void handleEvent(EventBundle events)
PostCommitEventListener
The events are fired as a BundleEvent
after the transaction is committed.
handleEvent
in interface PostCommitEventListener
events
- the events to handleprotected List<String> getAllGroupNames(String groupName, EventContext context)
protected void handleUpdatedGroups(List<String> groupNames)
protected DocumentModelList getImpactedDocuments(CoreSession session, List<String> groupNames)
protected void fireGroupUpdatedEvent(CoreSession session, DocumentModel source)
Copyright © 2018 Nuxeo. All rights reserved.