public class DefaultFilterSubscriptionService extends Object implements FilterSubscriptionService
Constructor and Description |
---|
DefaultFilterSubscriptionService(JiraAuthenticationContext jiraAuthenticationContext,
SubscriptionManager subscriptionManager) |
Modifier and Type | Method and Description |
---|---|
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 . |
protected String |
getText(String key) |
protected String |
getText(String key,
Object param) |
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)
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 |
public DefaultFilterSubscriptionService(JiraAuthenticationContext jiraAuthenticationContext, SubscriptionManager subscriptionManager)
public void validateCronExpression(JiraServiceContext context, String expr)
FilterSubscriptionService
ErrorCollection
of the JiraServiceContext
validateCronExpression
in interface FilterSubscriptionService
context
- jira service contextexpr
- Expression to evaluatepublic void storeSubscription(JiraServiceContext context, Long filterId, String groupName, String expr, boolean emailOnEmpty)
FilterSubscriptionService
storeSubscription
in interface FilterSubscriptionService
context
- jira service contextfilterId
- Id of the filter subscribing togroupName
- Sent to group (may be null if sent to self)expr
- Cron expression to storeemailOnEmpty
- send email if filter returns no resultspublic void updateSubscription(JiraServiceContext context, Long subscriptionId, String groupName, String expr, boolean emailOnEmpty)
FilterSubscriptionService
updateSubscription
in interface FilterSubscriptionService
context
- jira service contextsubscriptionId
- Id of the subscription being updatedgroupName
- Sent to group (may be null if sent to self)expr
- Cron expression to storeemailOnEmpty
- send email if filter returns no resultspublic String getPrettySchedule(JiraServiceContext context, String cronExpression)
FilterSubscriptionService
com.atlassian.core.cron.parser.CronExpressionParser
.getPrettySchedule
in interface FilterSubscriptionService
context
- the jira service context.cronExpression
- a cron expression.public String getCronExpression(JiraServiceContext context, FilterSubscription subscription)
FilterSubscriptionService
getCronExpression
in interface FilterSubscriptionService
public Collection<org.ofbiz.core.entity.GenericValue> getVisibleSubscriptions(ApplicationUser user, SearchRequest filter)
FilterSubscriptionService
getVisibleSubscriptions
in interface FilterSubscriptionService
user
- The user that can see the subscriptionsfilter
- The filter with teh associated subscriptionspublic Collection<FilterSubscription> getVisibleFilterSubscriptions(ApplicationUser user, SearchRequest filter)
FilterSubscriptionService
getVisibleFilterSubscriptions
in interface FilterSubscriptionService
user
- The user that can see the subscriptionsfilter
- The filter with teh associated subscriptionspublic Collection<org.ofbiz.core.entity.GenericValue> getVisibleSubscriptions(com.atlassian.crowd.embedded.api.User user, SearchRequest filter)
FilterSubscriptionService
getVisibleSubscriptions
in interface FilterSubscriptionService
user
- The user that can see the subscriptionsfilter
- The filter with teh associated subscriptions@Nullable public Date getNextSendTime(@Nonnull FilterSubscription sub)
FilterSubscriptionService
getNextSendTime
in interface FilterSubscriptionService
sub
- The subscriptionCopyright © 2002-2015 Atlassian. All Rights Reserved.