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
 Iterable<NotificationRecipient> addRecipient(NotificationFilterContext context, Iterable<NotificationRecipient> intendedRecipients)
          This called called to add possible new NotificationRecipients to a notification event.
 boolean removeRecipient(NotificationRecipient recipient, NotificationFilterContext context)
          This called called to remove NotificationRecipients from a notification event.
 

Method Detail

addRecipient

Iterable<NotificationRecipient> addRecipient(NotificationFilterContext context,
                                             Iterable<NotificationRecipient> intendedRecipients)
This called called to add possible new NotificationRecipients 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 JIRA AdhocNotificationService.

Parameters:
context - the context of this possible notification
intendedRecipients - this list of recipients that has been build up to this point.
Returns:
an iterable of new NotificationRecipients

removeRecipient

boolean removeRecipient(NotificationRecipient recipient,
                        NotificationFilterContext context)
This called called to remove NotificationRecipients 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 JIRA AdhocNotificationService.

This is ALWAYS called after addRecipient(NotificationFilterContext, Iterable) has been called for all plugins.

Parameters:
context - the context of this possible notification
Returns:
a boolean as to whether the user should get a notification


Copyright © 2002-2014 Atlassian. All Rights Reserved.