@PublicApi public interface

FilterSubscriptionService

com.atlassian.jira.bc.filter.FilterSubscriptionService
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).

Class Overview

Provides high level access to CRUD and query FilterSubscriptions.

Summary

Public Methods
String getCronExpression(JiraServiceContext context, FilterSubscription subscription)
Retrieve the cron expression associated with this subscription
@Nullable Date getNextSendTime(FilterSubscription sub)
Returns the next send time for this subscription.
String getPrettySchedule(JiraServiceContext context, String cronExpression)
Renders a human readable description of the given cron expression or returns the cron expression if it can't be parsed by the com.atlassian.core.cron.parser.CronExpressionParser.
Collection<FilterSubscription> getVisibleFilterSubscriptions(ApplicationUser user, SearchRequest filter)
Retrieves a list of subscriptions that a given user can see for a given filter.
void storeSubscription(JiraServiceContext context, Long filterId, String groupName, String expr, boolean emailOnEmpty)
Create and store a subscription that uses the given cron expression
void updateSubscription(JiraServiceContext context, Long subscriptionId, String groupName, String expr, boolean emailOnEmpty)
Updates the subscription to the new given values and persists.
void validateCronExpression(JiraServiceContext context, String expr)
Validates a given cron expression Errors are passed back in the ErrorCollection of the JiraServiceContext

Public Methods

public String getCronExpression (JiraServiceContext context, FilterSubscription subscription)

Retrieve the cron expression associated with this subscription

Returns
  • the cron expression associated with this subscription

@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 String getPrettySchedule (JiraServiceContext context, String cronExpression)

Renders a human readable description of the given cron expression or returns the cron expression if it can't be parsed by the com.atlassian.core.cron.parser.CronExpressionParser.

Parameters
context the jira service context.
cronExpression a cron expression.
Returns
  • a locale-specific sentence describing the cron string (or on failure, the cron string).

public Collection<FilterSubscription> getVisibleFilterSubscriptions (ApplicationUser user, SearchRequest filter)

Retrieves a list of subscriptions that a given user can see for a given filter. I.e. The owner can see all subscriptions for a filter, otherwise you can only see your own subscriptions.

Parameters
user The user that can see the subscriptions
filter The filter with teh associated subscriptions
Returns
  • A Collection of GenericValue subscriptions

public void storeSubscription (JiraServiceContext context, Long filterId, String groupName, String expr, boolean emailOnEmpty)

Create and store a subscription that uses the given cron expression

Parameters
context jira service context
filterId Id of the filter subscribing to
groupName Sent to group (may be null if sent to self)
expr Cron expression to store
emailOnEmpty send email if filter returns no results

public void updateSubscription (JiraServiceContext context, Long subscriptionId, String groupName, String expr, boolean emailOnEmpty)

Updates the subscription to the new given values and persists.

Parameters
context jira service context
subscriptionId Id of the subscription being updated
groupName Sent to group (may be null if sent to self)
expr Cron expression to store
emailOnEmpty send email if filter returns no results

public void validateCronExpression (JiraServiceContext context, String expr)

Validates a given cron expression Errors are passed back in the ErrorCollection of the JiraServiceContext

Parameters
context jira service context
expr Expression to evaluate