Package com.atlassian.jira.notification
Interface NotificationFilter
- All Known Implementing Classes:
ReferenceNotificationFilter
@PublicSpi
public interface NotificationFilter
A NotificationFilter allows a plugin to add and remove
NotificationRecipient
s to a notification event.
addRecipient(NotificationFilterContext, Iterable)
is always called first for all plugins and then removeRecipient(NotificationRecipient, NotificationFilterContext)
is called after that to remove any recipients that are not
needed.
You are very likely to be called multiple times during an issue event (depending on circumstances) and hence you need
to manager your side effects. The NotificationFilterContext
object passed to you has a state map where you
can place stateful information and perhaps prevent multiple effects happening (if need be).
- Since:
- v6.0
-
Method Summary
Modifier and TypeMethodDescriptionaddRecipient
(NotificationFilterContext context, Iterable<NotificationRecipient> intendedRecipients) This called called to add possible newNotificationRecipient
s to a notification event.boolean
removeRecipient
(NotificationRecipient recipient, NotificationFilterContext context) This called called to removeNotificationRecipient
s from a notification event.
-
Method Details
-
addRecipient
Iterable<NotificationRecipient> addRecipient(NotificationFilterContext context, Iterable<NotificationRecipient> intendedRecipients) This called called to add possible newNotificationRecipient
s to a notification event. Its possible that event is null in which case this means that there is no JIRA issue event in play but rather some other adhoc call to the JIRAAdhocNotificationService
.- Parameters:
context
- the context of this possible notificationintendedRecipients
- this list of recipients that has been build up to this point.- Returns:
- an iterable of new NotificationRecipients
-
removeRecipient
This called called to removeNotificationRecipient
s from a notification event. Its possible that event is null in which case this means that tyhere is no JIRA issue event in play but rather some other ahoc call to the JIRAAdhocNotificationService
.This is ALWAYS called after
addRecipient(NotificationFilterContext, Iterable)
has been called for all plugins.- Parameters:
context
- the context of this possible notification- Returns:
- true when recipient should be removed (shouldn't get notification), false when user should not be removed (should get notification).
-