Class AsynchronousUnicityCheckListener
- java.lang.Object
-
- org.nuxeo.ecm.platform.filemanager.core.listener.AbstractUnicityChecker
-
- org.nuxeo.ecm.platform.filemanager.core.listener.AsynchronousUnicityCheckListener
-
- All Implemented Interfaces:
PostCommitEventListener
,PostCommitFilteringEventListener
public class AsynchronousUnicityCheckListener extends AbstractUnicityChecker implements PostCommitFilteringEventListener
-
-
Field Summary
-
Fields inherited from class org.nuxeo.ecm.platform.filemanager.core.listener.AbstractUnicityChecker
DUPLICATED_FILE
-
-
Constructor Summary
Constructors Constructor Description AsynchronousUnicityCheckListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptEvent(Event event)
Checks if this event is worth passing to the asynchronousPostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle)
.void
handleEvent(EventBundle events)
Handles the set of events that were raised during the life of an user operation.protected void
onDuplicatedDoc(CoreSession session, NuxeoPrincipal principal, DocumentModel newDoc, List<DocumentLocation> existingDocs, Event event)
-
Methods inherited from class org.nuxeo.ecm.platform.filemanager.core.listener.AbstractUnicityChecker
doUnicityCheck, isUnicityCheckEnabled, raiseDuplicatedFileEvent
-
-
-
-
Method Detail
-
acceptEvent
public boolean acceptEvent(Event event)
Description copied from interface:PostCommitFilteringEventListener
Checks 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
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 inPostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle)
do the final filtering.- Specified by:
acceptEvent
in interfacePostCommitFilteringEventListener
- Parameters:
event
- the event- Returns:
true
to accept it, orfalse
to ignore it
-
handleEvent
public void handleEvent(EventBundle events)
Description copied from interface:PostCommitEventListener
Handles the set of events that were raised during the life of an user operation.The events are fired as a
BundleEvent
after the transaction is committed.- Specified by:
handleEvent
in interfacePostCommitEventListener
- Parameters:
events
- the events to handle
-
onDuplicatedDoc
protected void onDuplicatedDoc(CoreSession session, NuxeoPrincipal principal, DocumentModel newDoc, List<DocumentLocation> existingDocs, Event event)
- Specified by:
onDuplicatedDoc
in classAbstractUnicityChecker
-
-