Interface EventHandler
-
- All Known Subinterfaces:
ChildAssocEventHandler,NodeEventHandler,OnChildAssocCreatedEventHandler,OnChildAssocDeletedEventHandler,OnNodeCreatedEventHandler,OnNodeDeletedEventHandler,OnNodeUpdatedEventHandler,OnPeerAssocCreatedEventHandler,OnPeerAssocDeletedEventHandler,OnPermissionUpdatedEventHandler,PeerAssocEventHandler,PermissionEventHandler
public interface EventHandlerInterface that declares the operations of a repo event handler.An event handler will be triggered (the method
handleEventwill 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
getEventFilterthat 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
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default EventFiltergetEventFilter()Obtain theEventFilterthat any event must fulfill to be handled by this handler.Set<EventType>getHandledEventTypes()Obtain the set ofEventType's that this handler will handle.voidhandleEvent(RepoEvent<DataAttributes<Resource>> event)Handle aRepoEventthat must be treated by this handler.
-
-
-
Method Detail
-
getHandledEventTypes
Set<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
default EventFilter 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(RepoEvent<DataAttributes<Resource>> event)
Handle aRepoEventthat must be treated by this handler.- Parameters:
event- the correspondingRepoEventto be handled
-
-