com.atlassian.jira.bc.filter
Interface FilterSubscriptionService

All Known Implementing Classes:
DefaultFilterSubscriptionService

@PublicApi
public interface FilterSubscriptionService

Provides high level access to CRUD and query FilterSubscriptions.


Method Summary
 String getCronExpression(JiraServiceContext context, FilterSubscription subscription)
          Retrieve the cron expression associated with this subscription
 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.
 Collection<org.ofbiz.core.entity.GenericValue> getVisibleSubscriptions(ApplicationUser user, SearchRequest filter)
          Deprecated. Use use getVisibleFilterSubscriptions(ApplicationUser, SearchRequest) ()} instead. Since v6.2.
 Collection<org.ofbiz.core.entity.GenericValue> getVisibleSubscriptions(com.atlassian.crowd.embedded.api.User user, SearchRequest filter)
          Deprecated. Use use getVisibleFilterSubscriptions(ApplicationUser, SearchRequest) ()} instead. Since v6.2.
 void storeSubscription(JiraServiceContext context, Long filterId, String groupName, String expr, boolean emailOnEmpty)
          Create and store the Cron Trigger and subscription
 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
 

Method Detail

validateCronExpression

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

storeSubscription

void storeSubscription(JiraServiceContext context,
                       Long filterId,
                       String groupName,
                       String expr,
                       boolean emailOnEmpty)
Create and store the Cron Trigger and subscription

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

updateSubscription

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

getPrettySchedule

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

getVisibleFilterSubscriptions

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

getVisibleSubscriptions

Collection<org.ofbiz.core.entity.GenericValue> getVisibleSubscriptions(ApplicationUser user,
                                                                       SearchRequest filter)
Deprecated. Use use getVisibleFilterSubscriptions(ApplicationUser, SearchRequest) ()} instead. Since v6.2.

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

getVisibleSubscriptions

Collection<org.ofbiz.core.entity.GenericValue> getVisibleSubscriptions(com.atlassian.crowd.embedded.api.User user,
                                                                       SearchRequest filter)
Deprecated. Use use getVisibleFilterSubscriptions(ApplicationUser, SearchRequest) ()} instead. Since v6.2.

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

getCronExpression

String getCronExpression(JiraServiceContext context,
                         FilterSubscription subscription)
Retrieve the cron expression associated with this subscription

Parameters:
subscription -
Returns:
the cron expression associated with this subscription

getNextSendTime

@Nullable
Date getNextSendTime(@Nonnull
                              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


Copyright © 2002-2014 Atlassian. All Rights Reserved.