public class DefaultSubscriptionManager extends MailingListCompiler implements SubscriptionManager, GroupConfigurable
| Modifier and Type | Field and Description |
|---|---|
static String |
JOB_RUNNER_KEY |
static String |
SUBSCRIPTION_PREFIX |
SUBSCRIPTION_IDENTIFIER| Constructor and Description |
|---|
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) |
| Modifier and Type | Method and Description |
|---|---|
FilterSubscription |
createSubscription(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 trigger
|
void |
deleteSubscription(Long subId) |
void |
deleteSubscriptionsForGroup(com.atlassian.crowd.embedded.api.Group group) |
void |
deleteSubscriptionsForUser(ApplicationUser user)
Delete all subscriptions owned by a user.
|
List<FilterSubscription> |
getAllFilterSubscriptions() |
List<FilterSubscription> |
getAllFilterSubscriptions(Long filterId) |
String |
getCronExpressionForSubscription(FilterSubscription subscription)
Retrieve the cron expression associated with this subscription
|
FilterSubscription |
getFilterSubscription(ApplicationUser user,
Long subId) |
FilterSubscription |
getFilterSubscription(Long subId)
Get a subscription by Id
|
List<FilterSubscription> |
getFilterSubscriptions(ApplicationUser user,
Long filterId) |
Date |
getNextSendTime(FilterSubscription sub)
Returns the next send time for this subscription.
|
List<FilterSubscription> |
getSubscriptionsForUser(ApplicationUser user)
Get all subscriptions owned by the given user
|
boolean |
hasSubscription(ApplicationUser user,
Long filterId) |
boolean |
isGroupUsed(com.atlassian.crowd.embedded.api.Group group)
Determine whether configuration exists for the specified
Group. |
void |
runSubscription(ApplicationUser user,
Long subId)
Run this subscription now.
|
void |
runSubscription(Long subId) |
void |
updateSubscription(ApplicationUser user,
Long subId,
String groupName,
String cronExpression,
Boolean emailOnEmpty) |
getEmailAddresses, prepareEmail, sendListsclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisGroupUsedpublic static final String SUBSCRIPTION_PREFIX
public static final String JOB_RUNNER_KEY
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)
public boolean hasSubscription(ApplicationUser user, Long filterId) throws org.ofbiz.core.entity.GenericEntityException
hasSubscription in interface SubscriptionManagerorg.ofbiz.core.entity.GenericEntityExceptionpublic FilterSubscription getFilterSubscription(Long subId) throws org.ofbiz.core.entity.GenericEntityException
SubscriptionManagergetFilterSubscription in interface SubscriptionManagersubId - Subscription Idorg.ofbiz.core.entity.GenericEntityExceptionpublic FilterSubscription getFilterSubscription(ApplicationUser user, Long subId) throws org.ofbiz.core.entity.GenericEntityException
getFilterSubscription in interface SubscriptionManagerorg.ofbiz.core.entity.GenericEntityExceptionpublic List<FilterSubscription> getFilterSubscriptions(ApplicationUser user, Long filterId) throws org.ofbiz.core.entity.GenericEntityException
getFilterSubscriptions in interface SubscriptionManagerorg.ofbiz.core.entity.GenericEntityException@Nullable public String getCronExpressionForSubscription(FilterSubscription subscription)
SubscriptionManagergetCronExpressionForSubscription in interface SubscriptionManagerpublic void updateSubscription(ApplicationUser user, Long subId, String groupName, String cronExpression, Boolean emailOnEmpty) throws DataAccessException
updateSubscription in interface SubscriptionManageruser - 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 withDataAccessException - if there is a problem persisting the data.public List<FilterSubscription> getAllFilterSubscriptions(Long filterId)
getAllFilterSubscriptions in interface SubscriptionManagerpublic List<FilterSubscription> getAllFilterSubscriptions()
getAllFilterSubscriptions in interface SubscriptionManager@Nonnull public List<FilterSubscription> getSubscriptionsForUser(@Nullable ApplicationUser user)
SubscriptionManagergetSubscriptionsForUser in interface SubscriptionManageruser - subscription owner or null for an anonymous userpublic FilterSubscription createSubscription(ApplicationUser user, Long filterId, String groupName, String cronExpression, Boolean emailOnEmpty)
SubscriptionManagercreateSubscription in interface SubscriptionManageruser - 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@Nullable public Date getNextSendTime(@Nonnull FilterSubscription sub)
SubscriptionManagergetNextSendTime in interface SubscriptionManagersub - The subscriptionpublic void deleteSubscription(Long subId) throws org.ofbiz.core.entity.GenericEntityException
deleteSubscription in interface SubscriptionManagerorg.ofbiz.core.entity.GenericEntityExceptionpublic void deleteSubscriptionsForUser(@Nonnull ApplicationUser user) throws org.ofbiz.core.entity.GenericEntityException
SubscriptionManagerdeleteSubscriptionsForUser in interface SubscriptionManageruser - the current user performing this operationorg.ofbiz.core.entity.GenericEntityExceptionpublic void runSubscription(Long subId) throws org.ofbiz.core.entity.GenericEntityException
runSubscription in interface SubscriptionManagerorg.ofbiz.core.entity.GenericEntityExceptionpublic void runSubscription(ApplicationUser user, Long subId) throws org.ofbiz.core.entity.GenericEntityException
SubscriptionManagerrunSubscription in interface SubscriptionManageruser - the current user performing this operationsubId - identifies the subscription to updateorg.ofbiz.core.entity.GenericEntityExceptionpublic void deleteSubscriptionsForGroup(com.atlassian.crowd.embedded.api.Group group)
throws org.ofbiz.core.entity.GenericEntityException
deleteSubscriptionsForGroup in interface SubscriptionManagerorg.ofbiz.core.entity.GenericEntityExceptionpublic boolean isGroupUsed(@Nonnull com.atlassian.crowd.embedded.api.Group group)
GroupConfigurableGroup.isGroupUsed in interface GroupConfigurablegroup - that may or may not exist.Copyright © 2002-2021 Atlassian. All Rights Reserved.