@PublicApi public interface

SubscriptionManager

com.atlassian.jira.issue.subscription.SubscriptionManager
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Summary

Constants
String SUBSCRIPTION_IDENTIFIER
Public Methods
FilterSubscription createSubscription(ApplicationUser user, Long filterId, String groupName, String cronExpression, Boolean emailOnEmpty)
Creates a new subscription based on the passed in filter id and fired in accordance with the passed in trigger
void deleteSubscription(Long subId)
void deleteSubscriptionsForGroup(Group group)
void deleteSubscriptionsForUser(ApplicationUser user)
Delete all subscriptions owned by a user.
List<FilterSubscription> getAllFilterSubscriptions()
List<FilterSubscription> getAllFilterSubscriptions(Long filterId)
String getCronExpressionForSubscription(FilterSubscription subscription)
Retrieve the cron expression associated with this subscription
FilterSubscription getFilterSubscription(ApplicationUser user, Long subId)
FilterSubscription getFilterSubscription(Long subId)
Get a subscription by Id
List<FilterSubscription> getFilterSubscriptions(ApplicationUser user, Long filterId)
@Nullable Date getNextSendTime(FilterSubscription sub)
Returns the next send time for this subscription.
boolean hasSubscription(ApplicationUser user, Long filterId)
void runSubscription(Long subId)
void runSubscription(ApplicationUser user, Long subId)
Run this subscription now.
void updateSubscription(ApplicationUser user, Long subscriptionId, String groupName, String cronExpression, Boolean emailOnEmpty)

Constants

public static final String SUBSCRIPTION_IDENTIFIER

Constant Value: "SUBSCRIPTION_ID"

Public Methods

public FilterSubscription createSubscription (ApplicationUser user, Long filterId, String groupName, String cronExpression, Boolean emailOnEmpty)

Creates a new subscription based on the passed in filter id and fired in accordance with the passed in trigger

Parameters
user the current user performing this operation
filterId Id of the filter subscribing to
groupName Sent ot group
cronExpression The Cron expression for the subscription
emailOnEmpty send email if filter returns no results
Returns
  • FilterSubscription representing new subscription

public void deleteSubscription (Long subId)

Throws
GenericEntityException

public void deleteSubscriptionsForGroup (Group group)

Throws
GenericEntityException

public void deleteSubscriptionsForUser (ApplicationUser user)

Delete all subscriptions owned by a user.

Parameters
user the current user performing this operation
Throws
GenericEntityException

public List<FilterSubscription> getAllFilterSubscriptions ()

public List<FilterSubscription> getAllFilterSubscriptions (Long filterId)

public String getCronExpressionForSubscription (FilterSubscription subscription)

Retrieve the cron expression associated with this subscription

Returns
  • the cron expression associated with this subscription

public FilterSubscription getFilterSubscription (ApplicationUser user, Long subId)

Throws
GenericEntityException

public FilterSubscription getFilterSubscription (Long subId)

Get a subscription by Id

Parameters
subId Subscription Id
Returns
  • Subscription
Throws
GenericEntityException
GenericEntityException

public List<FilterSubscription> getFilterSubscriptions (ApplicationUser user, Long filterId)

Throws
GenericEntityException

@Nullable public Date getNextSendTime (FilterSubscription sub)

Returns the next send time for this subscription. This may return null if the scheduler does not support the reporting of next send times.

Parameters
sub The subscription
Returns
  • Next send time

public boolean hasSubscription (ApplicationUser user, Long filterId)

Throws
GenericEntityException

public void runSubscription (Long subId)

Throws
GenericEntityException

public void runSubscription (ApplicationUser user, Long subId)

Run this subscription now.

Parameters
user the current user performing this operation
subId identifies the subscription to update
Throws
GenericEntityException

public void updateSubscription (ApplicationUser user, Long subscriptionId, String groupName, String cronExpression, Boolean emailOnEmpty)

Parameters
user the current user performing this operation
subscriptionId identifies the subscription to update
groupName (optional) the name of the group to receive the email
cronExpression The Cron expression to update the subscription with
Throws
DataAccessException if there is a problem persisting the data.