Class DefaultSubscriptionManager
java.lang.Object
com.atlassian.jira.mail.MailingListCompiler
com.atlassian.jira.issue.subscription.DefaultSubscriptionManager
- All Implemented Interfaces:
GroupConfigurable,SubscriptionManager
public class DefaultSubscriptionManager
extends MailingListCompiler
implements SubscriptionManager, GroupConfigurable
-
Field Summary
FieldsFields inherited from interface com.atlassian.jira.issue.subscription.SubscriptionManager
SUBSCRIPTION_IDENTIFIER -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSubscriptionManager(com.atlassian.mail.queue.MailQueue mailQueue, TemplateManager templateManager, SubscriptionMailQueueItemFactory subscriptionMailQueueItemFactory, ProjectRoleManager projectRoleManager, GroupManager groupManager, com.atlassian.scheduler.SchedulerService schedulerService, EntityEngine entityEngine, DateTimeFormatterFactory dateTimeFormatterFactory, UserManager userManager, FeatureManager featureManager) -
Method Summary
Modifier and TypeMethodDescriptioncreateSubscription(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 triggervoiddeleteSubscription(Long subId) voiddeleteSubscriptionsForGroup(com.atlassian.crowd.embedded.api.Group group) voidDelete all subscriptions owned by a user.getAllFilterSubscriptions(Long filterId) getCronExpressionForSubscription(FilterSubscription subscription) Retrieve the cron expression associated with this subscriptiongetFilterSubscription(ApplicationUser user, Long subId) getFilterSubscription(Long subId) Get a subscription by IdgetFilterSubscriptions(ApplicationUser user, Long filterId) Returns the next send time for this subscription.Get all subscriptions owned by the given userbooleanhasSubscription(ApplicationUser user, Long filterId) booleanisGroupUsed(com.atlassian.crowd.embedded.api.Group group) Determine whether configuration exists for the specifiedGroup.voidrunSubscription(ApplicationUser user, Long subId) Run this subscription now.voidrunSubscription(Long subId) voidupdateSubscription(ApplicationUser user, Long subId, String groupName, String cronExpression, Boolean emailOnEmpty) Methods inherited from class com.atlassian.jira.mail.MailingListCompiler
getEmailAddresses, prepareEmail, sendListsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.jira.config.group.GroupConfigurable
isGroupUsed
-
Field Details
-
SUBSCRIPTION_PREFIX
-
JOB_RUNNER_KEY
-
-
Constructor Details
-
DefaultSubscriptionManager
public DefaultSubscriptionManager(com.atlassian.mail.queue.MailQueue mailQueue, TemplateManager templateManager, SubscriptionMailQueueItemFactory subscriptionMailQueueItemFactory, ProjectRoleManager projectRoleManager, GroupManager groupManager, com.atlassian.scheduler.SchedulerService schedulerService, EntityEngine entityEngine, DateTimeFormatterFactory dateTimeFormatterFactory, UserManager userManager, FeatureManager featureManager)
-
-
Method Details
-
hasSubscription
public boolean hasSubscription(ApplicationUser user, Long filterId) throws org.ofbiz.core.entity.GenericEntityException - Specified by:
hasSubscriptionin interfaceSubscriptionManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getFilterSubscription
public FilterSubscription getFilterSubscription(Long subId) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:SubscriptionManagerGet a subscription by Id- Specified by:
getFilterSubscriptionin interfaceSubscriptionManager- Parameters:
subId- Subscription Id- Returns:
- Subscription
- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getFilterSubscription
public FilterSubscription getFilterSubscription(ApplicationUser user, Long subId) throws org.ofbiz.core.entity.GenericEntityException - Specified by:
getFilterSubscriptionin interfaceSubscriptionManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getFilterSubscriptions
public List<FilterSubscription> getFilterSubscriptions(ApplicationUser user, Long filterId) throws org.ofbiz.core.entity.GenericEntityException - Specified by:
getFilterSubscriptionsin interfaceSubscriptionManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getCronExpressionForSubscription
Description copied from interface:SubscriptionManagerRetrieve the cron expression associated with this subscription- Specified by:
getCronExpressionForSubscriptionin interfaceSubscriptionManager- Returns:
- the cron expression associated with this subscription
-
updateSubscription
public void updateSubscription(ApplicationUser user, Long subId, String groupName, String cronExpression, Boolean emailOnEmpty) throws DataAccessException - Specified by:
updateSubscriptionin interfaceSubscriptionManager- Parameters:
user- new owner for the subscriptionsubId- identifies the subscription to updategroupName- (optional) the name of the group to receive the emailcronExpression- The Cron expression to update the subscription with- Throws:
DataAccessException- if there is a problem persisting the data.
-
getAllFilterSubscriptions
- Specified by:
getAllFilterSubscriptionsin interfaceSubscriptionManager
-
getAllFilterSubscriptions
- Specified by:
getAllFilterSubscriptionsin interfaceSubscriptionManager
-
getSubscriptionsForUser
Description copied from interface:SubscriptionManagerGet all subscriptions owned by the given user- Specified by:
getSubscriptionsForUserin interfaceSubscriptionManager- Parameters:
user- subscription owner or null for an anonymous user- Returns:
- list of subscriptions. Can be empty.
-
createSubscription
public FilterSubscription createSubscription(ApplicationUser user, Long filterId, String groupName, String cronExpression, Boolean emailOnEmpty) Description copied from interface:SubscriptionManagerCreates a new subscription based on the passed in filter id and fired in accordance with the passed in trigger- Specified by:
createSubscriptionin interfaceSubscriptionManager- Parameters:
user- the owner of the subscriptionfilterId- Id of the filter subscribing togroupName- Sent ot groupcronExpression- The Cron expression for the subscriptionemailOnEmpty- send email if filter returns no results- Returns:
- FilterSubscription representing new subscription
-
getNextSendTime
Description copied from interface:SubscriptionManagerReturns the next send time for this subscription. This may return null if the scheduler does not support the reporting of next send times.- Specified by:
getNextSendTimein interfaceSubscriptionManager- Parameters:
sub- The subscription- Returns:
- Next send time
-
deleteSubscription
- Specified by:
deleteSubscriptionin interfaceSubscriptionManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
deleteSubscriptionsForUser
public void deleteSubscriptionsForUser(@Nonnull ApplicationUser user) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:SubscriptionManagerDelete all subscriptions owned by a user.- Specified by:
deleteSubscriptionsForUserin interfaceSubscriptionManager- Parameters:
user- the current user performing this operation- Throws:
org.ofbiz.core.entity.GenericEntityException
-
runSubscription
- Specified by:
runSubscriptionin interfaceSubscriptionManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
runSubscription
public void runSubscription(ApplicationUser user, Long subId) throws org.ofbiz.core.entity.GenericEntityException Description copied from interface:SubscriptionManagerRun this subscription now.- Specified by:
runSubscriptionin interfaceSubscriptionManager- Parameters:
user- the current user performing this operationsubId- identifies the subscription to update- Throws:
org.ofbiz.core.entity.GenericEntityException
-
deleteSubscriptionsForGroup
public void deleteSubscriptionsForGroup(com.atlassian.crowd.embedded.api.Group group) throws org.ofbiz.core.entity.GenericEntityException - Specified by:
deleteSubscriptionsForGroupin interfaceSubscriptionManager- Throws:
org.ofbiz.core.entity.GenericEntityException
-
isGroupUsed
public boolean isGroupUsed(@Nonnull com.atlassian.crowd.embedded.api.Group group) Description copied from interface:GroupConfigurableDetermine whether configuration exists for the specifiedGroup.- Specified by:
isGroupUsedin interfaceGroupConfigurable- Parameters:
group- that may or may not exist.- Returns:
- true if the group is used in the components configuration.
-