@PublicSpi public interface

NotificationFilter

com.atlassian.jira.notification.NotificationFilter
Known Indirect Subclasses

@PublicSpi

This interface is designed for plugins to implement.

Clients of @PublicSpi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicSpi as per each product's API policy (clients should refer to each product's API policy for the exact guarantee -- usually binary compatibility is guaranteed at least across minor versions).

Note: @PublicSpi interfaces and classes are specifically designed to be implemented/extended by clients. Hence, the guarantee of binary compatibility is different to that of @PublicApi elements (if an element is both @PublicApi and @PublicSpi, both guarantees apply).

Class Overview

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).

Summary

Public Methods
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.

Public Methods

public 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

public 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