Interface EventHandler
- All Known Subinterfaces:
ChildAssocEventHandler,NodeEventHandler,OnChildAssocCreatedEventHandler,OnChildAssocDeletedEventHandler,OnNodeCreatedEventHandler,OnNodeDeletedEventHandler,OnNodeUpdatedEventHandler,OnPeerAssocCreatedEventHandler,OnPeerAssocDeletedEventHandler,OnPermissionUpdatedEventHandler,PeerAssocEventHandler,PermissionEventHandler
public interface EventHandler
Interface that declares the operations of a repo event handler.
An event handler will be triggered (the method handleEvent will be executed) when:
- The event type matches with the one of the returned by the method
getHandledEventTypes - The event fulfills the conditions specified by the
EventFilterreturned by the methodgetEventFilter
This class provides a default implementation for the method getEventFilter that provides an always-true filter. This means that, by default,
all events that match the event type will be handled by an event handler.
-
Method Summary
Modifier and TypeMethodDescriptiondefault EventFilterObtain theEventFilterthat any event must fulfill to be handled by this handler.Set<org.alfresco.repo.event.v1.model.EventType>Obtain the set ofEventType's that this handler will handle.voidhandleEvent(org.alfresco.repo.event.v1.model.RepoEvent<org.alfresco.repo.event.v1.model.DataAttributes<org.alfresco.repo.event.v1.model.Resource>> event) Handle aRepoEventthat must be treated by this handler.
-
Method Details
-
getHandledEventTypes
Set<org.alfresco.repo.event.v1.model.EventType> getHandledEventTypes()Obtain the set ofEventType's that this handler will handle.- Returns:
- the set of
EventType's handled by this handler. Ths value must not benull
-
getEventFilter
Obtain theEventFilterthat any event must fulfill to be handled by this handler.- Returns:
- the
EventFilterto be fulfilled. This value must nor benull
-
handleEvent
void handleEvent(org.alfresco.repo.event.v1.model.RepoEvent<org.alfresco.repo.event.v1.model.DataAttributes<org.alfresco.repo.event.v1.model.Resource>> event) Handle aRepoEventthat must be treated by this handler.- Parameters:
event- the correspondingRepoEventto be handled
-