Package org.nuxeo.drive.listener
Class NuxeoDriveFileSystemDeletionListener
- java.lang.Object
-
- org.nuxeo.drive.listener.NuxeoDriveFileSystemDeletionListener
-
- All Implemented Interfaces:
EventListener
public class NuxeoDriveFileSystemDeletionListener extends Object implements EventListener
Synchronous event listener to track events that cannot be directly handled by theFileSystemChangeFinder
because the document bound to the event is either no more adaptable as aFileSystemItem
after the transaction has been committed (e.g. deletion) or not a descendant of a synchronization root (e.g. security update on any document). In particular this includes:- Synchronization root unregistration (user specific).
- Simple document or synchronization root trashed state change to trashed.
- Simple document or synchronization root physical removal from the directory.
- Update of a document after which it has no blob.
- Move of a document to a non synchronized folder.
- Security update.
- Group change.
The listener injects virtual entries in the audit logs with the
NuxeoDriveEvents.EVENT_CATEGORY
category to be handled by theFileSystemChangeFinder
. These entries are set in the context of aNuxeoDriveEvents.VIRTUAL_EVENT_CREATED
event handled by the post-commit asynchronousNuxeoDriveVirtualEventLogger
to ensure that the transaction is committed before the log entries are actually added.
-
-
Constructor Summary
Constructors Constructor Description NuxeoDriveFileSystemDeletionListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected LogEntry
computeLogEntry(String eventName, Date eventDate, String docId, String docPath, String principal, String docType, String repositoryName, String currentLifeCycleState, String impactedUserName, FileSystemItem fsItem)
protected void
fireVirtualEventLogEntries(DocumentModel doc, String eventName, NuxeoPrincipal principal, String impactedUserName, CoreSession session)
protected List<DocumentModel>
getChildSyncRoots(DocumentModel doc, CoreSession session)
protected FileSystemItem
getFileSystemItem(DocumentModel doc, String eventName)
protected boolean
handleAboutToRemove(DocumentModel doc)
protected DocumentModel
handleBeforeDocUpdate(DocumentEventContext ctx, DocumentModel doc)
void
handleEvent(Event event)
Handle the given event.protected boolean
handleLifeCycleTransition(DocumentEventContext ctx)
-
-
-
Method Detail
-
handleEvent
public void handleEvent(Event event)
Description copied from interface:EventListener
Handle the given event. The listener can cancel the event by callingEvent.cancel()
- Specified by:
handleEvent
in interfaceEventListener
- Parameters:
event
- the event
-
handleBeforeDocUpdate
protected DocumentModel handleBeforeDocUpdate(DocumentEventContext ctx, DocumentModel doc)
-
handleLifeCycleTransition
protected boolean handleLifeCycleTransition(DocumentEventContext ctx)
-
handleAboutToRemove
protected boolean handleAboutToRemove(DocumentModel doc)
-
fireVirtualEventLogEntries
protected void fireVirtualEventLogEntries(DocumentModel doc, String eventName, NuxeoPrincipal principal, String impactedUserName, CoreSession session)
-
getFileSystemItem
protected FileSystemItem getFileSystemItem(DocumentModel doc, String eventName)
-
getChildSyncRoots
protected List<DocumentModel> getChildSyncRoots(DocumentModel doc, CoreSession session)
-
-