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 EventFilter returned by the method getEventFilter

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 Type
    Method
    Description
    default EventFilter
    Obtain the EventFilter that any event must fulfill to be handled by this handler.
    Set<org.alfresco.repo.event.v1.model.EventType>
    Obtain the set of EventType's that this handler will handle.
    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 a RepoEvent that must be treated by this handler.
  • Method Details

    • getHandledEventTypes

      Set<org.alfresco.repo.event.v1.model.EventType> getHandledEventTypes()
      Obtain the set of EventType's that this handler will handle.
      Returns:
      the set of EventType's handled by this handler. Ths value must not be null
    • getEventFilter

      default EventFilter getEventFilter()
      Obtain the EventFilter that any event must fulfill to be handled by this handler.
      Returns:
      the EventFilter to be fulfilled. This value must nor be null
    • 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 a RepoEvent that must be treated by this handler.
      Parameters:
      event - the corresponding RepoEvent to be handled