Package org.nuxeo.drive.listener
Class NuxeoDriveFileSystemDeletionListener
java.lang.Object
org.nuxeo.drive.listener.NuxeoDriveFileSystemDeletionListener
- All Implemented Interfaces:
EventListener
Synchronous event listener to track events that cannot be directly handled by the
FileSystemChangeFinder
because the document bound to the event is either no more adaptable as a FileSystemItem
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 the FileSystemChangeFinder
. These entries are set in the context of a
NuxeoDriveEvents.VIRTUAL_EVENT_CREATED
event handled by the post-commit asynchronous
NuxeoDriveVirtualEventLogger
to ensure that the transaction is committed before the log entries are actually
added.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
protected DocumentModel
void
handleEvent
(Event event) Handle the given event.protected boolean
-
Constructor Details
-
NuxeoDriveFileSystemDeletionListener
public NuxeoDriveFileSystemDeletionListener()
-
-
Method Details
-
handleEvent
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
-
handleLifeCycleTransition
-
handleAboutToRemove
-
fireVirtualEventLogEntries
protected void fireVirtualEventLogEntries(DocumentModel doc, String eventName, NuxeoPrincipal principal, String impactedUserName, CoreSession session) -
getFileSystemItem
-
getChildSyncRoots
-
computeLogEntry
-