T
- Event to which this listener would listen to.public abstract class AbstractNotificationEventListener<T extends com.atlassian.event.Event> extends Object implements HibernateEventListener
Modifier and Type | Field and Description |
---|---|
protected CachedPlanManager |
cachedPlanManager |
protected Class<T> |
eventClass |
protected NotificationDispatcher |
notificationDispatcher |
protected NotificationManager |
notificationManager |
protected Set<Class<? extends NotificationType>> |
notificationTypeFilter |
protected SystemNotificationService |
systemNotificationService |
Modifier | Constructor and Description |
---|---|
protected |
AbstractNotificationEventListener(Class<T> eventClass,
Set<Class<? extends NotificationType>> notificationTypeFilter) |
Modifier and Type | Method and Description |
---|---|
protected Iterable<NotificationRule> |
filterNotificationRules(Iterable<NotificationRule> iterable,
T event)
Filter passed Iterable by list of classes in notificationTypeFilter and by call to NotificationType#isNotificationRequired(Event).
|
Class<? extends com.atlassian.event.Event>[] |
getHandledEventClasses() |
protected Iterable<NotificationRule> |
getNotificationRules(ImmutablePlan plan,
T event)
Return notification rules effective for a given plan and event.
|
protected ImmutablePlan |
getPlan(T event)
Try to retrieve plan using data in the event.
|
protected Iterable<NotificationRule> |
getSystemNotificationRules(T event)
Return system notification rules effective for a given event.
|
void |
handleEvent(com.atlassian.event.Event event)
Implementation of HibernateEventListener#handleEvent
|
abstract void |
handleEvent(T event,
ImmutablePlan plan)
Notification event listeners must implement this method to handle incoming events.
|
void |
setCachedPlanManager(CachedPlanManager cachedPlanManager) |
void |
setNotificationDispatcher(NotificationDispatcher notificationDispatcher) |
void |
setNotificationManager(NotificationManager notificationManager) |
void |
setSystemNotificationService(SystemNotificationService systemNotificationService) |
protected NotificationDispatcher notificationDispatcher
protected NotificationManager notificationManager
protected CachedPlanManager cachedPlanManager
protected SystemNotificationService systemNotificationService
protected final Set<Class<? extends NotificationType>> notificationTypeFilter
protected AbstractNotificationEventListener(Class<T> eventClass, Set<Class<? extends NotificationType>> notificationTypeFilter)
eventClass
- Class of event this listener would listen tonotificationTypeFilter
- Set of notification types this listener is interested inpublic Class<? extends com.atlassian.event.Event>[] getHandledEventClasses()
getHandledEventClasses
in interface HibernateEventListener
getHandledEventClasses
in interface com.atlassian.event.EventListener
protected Iterable<NotificationRule> getNotificationRules(@NotNull ImmutablePlan plan, @NotNull T event)
plan
- Plan which notification rules list will be filteredevent
- Event which is being handled. It is passed to NotificationType#isNotificationRequired method to filter out notification rulesprotected Iterable<NotificationRule> getSystemNotificationRules(@NotNull T event)
event
- Event which is being handled. It is passed to NotificationType#isNotificationRequired method to filter out notification rulesprotected Iterable<NotificationRule> filterNotificationRules(@NotNull Iterable<NotificationRule> iterable, @NotNull T event)
iterable
- Input iterableevent
- Event which is being handled. It is passed to NotificationType#isNotificationRequired method to filter out notification rulespublic abstract void handleEvent(@NotNull T event, @NotNull ImmutablePlan plan)
event
- event to be handled (narrowed to effective class of event being handled)plan
- plan which is related to event being handledpublic void handleEvent(com.atlassian.event.Event event)
handleEvent
in interface HibernateEventListener
handleEvent
in interface com.atlassian.event.EventListener
event
- Event to be handled@Nullable protected ImmutablePlan getPlan(@NotNull T event)
event
- Event being handledpublic void setNotificationDispatcher(NotificationDispatcher notificationDispatcher)
public void setNotificationManager(NotificationManager notificationManager)
public void setCachedPlanManager(CachedPlanManager cachedPlanManager)
public void setSystemNotificationService(SystemNotificationService systemNotificationService)
Copyright © 2019 Atlassian Software Systems Pty Ltd. All rights reserved.