com.atlassian.jira.bc.filter
Class DefaultFilterSubscriptionService

java.lang.Object
  extended by com.atlassian.jira.bc.filter.DefaultFilterSubscriptionService
All Implemented Interfaces:
FilterSubscriptionService

public class DefaultFilterSubscriptionService
extends Object
implements FilterSubscriptionService

Uses quartz implementation of CronTrigger


Constructor Summary
DefaultFilterSubscriptionService(JiraAuthenticationContext jiraAuthenticationContext, SubscriptionManager subscriptionManager)
           
 
Method Summary
 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.
protected  String getText(String key)
           
protected  String getText(String key, Object param)
           
 Collection<org.ofbiz.core.entity.GenericValue> getVisibleSubscriptions(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(com.atlassian.crowd.embedded.api.User 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 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFilterSubscriptionService

public DefaultFilterSubscriptionService(JiraAuthenticationContext jiraAuthenticationContext,
                                        SubscriptionManager subscriptionManager)
Method Detail

validateCronExpression

public void validateCronExpression(JiraServiceContext context,
                                   String expr)
Description copied from interface: FilterSubscriptionService
Validates a given cron expression Errors are passed back in the ErrorCollection of the JiraServiceContext

Specified by:
validateCronExpression in interface FilterSubscriptionService
Parameters:
context - jira service context
expr - Expression to evaluate

storeSubscription

public void storeSubscription(JiraServiceContext context,
                              Long filterId,
                              String groupName,
                              String expr,
                              boolean emailOnEmpty)
Description copied from interface: FilterSubscriptionService
Create and store the Cron Trigger and subscription

Specified by:
storeSubscription in interface FilterSubscriptionService
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

public void updateSubscription(JiraServiceContext context,
                               Long subscriptionId,
                               String groupName,
                               String expr,
                               boolean emailOnEmpty)
Description copied from interface: FilterSubscriptionService
Updates the subscription to the new given values and persists.

Specified by:
updateSubscription in interface FilterSubscriptionService
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

public String getPrettySchedule(JiraServiceContext context,
                                String cronExpression)
Description copied from interface: FilterSubscriptionService
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.

Specified by:
getPrettySchedule in interface FilterSubscriptionService
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).

getVisibleSubscriptions

public Collection<org.ofbiz.core.entity.GenericValue> getVisibleSubscriptions(ApplicationUser user,
                                                                              SearchRequest filter)
Description copied from interface: FilterSubscriptionService
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.

Specified by:
getVisibleSubscriptions in interface FilterSubscriptionService
Parameters:
user - The user that can see the subscriptions
filter - The filter with teh associated subscriptions
Returns:
A Collection of GenericValue subscriptions

getVisibleSubscriptions

public Collection<org.ofbiz.core.entity.GenericValue> getVisibleSubscriptions(com.atlassian.crowd.embedded.api.User user,
                                                                              SearchRequest filter)
Description copied from interface: FilterSubscriptionService
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.

Specified by:
getVisibleSubscriptions in interface FilterSubscriptionService
Parameters:
user - The user that can see the subscriptions
filter - The filter with teh associated subscriptions
Returns:
A Collection of GenericValue subscriptions

getText

protected String getText(String key)

getText

protected String getText(String key,
                         Object param)


Copyright © 2002-2013 Atlassian. All Rights Reserved.