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) |
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, sendLists
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isGroupUsed
public 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)
public boolean hasSubscription(ApplicationUser user, Long filterId) throws org.ofbiz.core.entity.GenericEntityException
hasSubscription
in interface SubscriptionManager
org.ofbiz.core.entity.GenericEntityException
public FilterSubscription getFilterSubscription(Long subId) throws org.ofbiz.core.entity.GenericEntityException
SubscriptionManager
getFilterSubscription
in interface SubscriptionManager
subId
- Subscription Idorg.ofbiz.core.entity.GenericEntityException
public FilterSubscription getFilterSubscription(ApplicationUser user, Long subId) throws org.ofbiz.core.entity.GenericEntityException
getFilterSubscription
in interface SubscriptionManager
org.ofbiz.core.entity.GenericEntityException
public List<FilterSubscription> getFilterSubscriptions(ApplicationUser user, Long filterId) throws org.ofbiz.core.entity.GenericEntityException
getFilterSubscriptions
in interface SubscriptionManager
org.ofbiz.core.entity.GenericEntityException
@Nullable public String getCronExpressionForSubscription(FilterSubscription subscription)
SubscriptionManager
getCronExpressionForSubscription
in interface SubscriptionManager
public void updateSubscription(ApplicationUser user, Long subId, String groupName, String cronExpression, Boolean emailOnEmpty) throws DataAccessException
updateSubscription
in interface SubscriptionManager
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 withDataAccessException
- if there is a problem persisting the data.public List<FilterSubscription> getAllFilterSubscriptions(Long filterId)
getAllFilterSubscriptions
in interface SubscriptionManager
public List<FilterSubscription> getAllFilterSubscriptions()
getAllFilterSubscriptions
in interface SubscriptionManager
@Nonnull public List<FilterSubscription> getSubscriptionsForUser(@Nullable ApplicationUser user)
SubscriptionManager
getSubscriptionsForUser
in interface SubscriptionManager
user
- subscription owner or null for an anonymous userpublic FilterSubscription createSubscription(ApplicationUser user, Long filterId, String groupName, String cronExpression, Boolean emailOnEmpty)
SubscriptionManager
createSubscription
in interface SubscriptionManager
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@Nullable public Date getNextSendTime(@Nonnull FilterSubscription sub)
SubscriptionManager
getNextSendTime
in interface SubscriptionManager
sub
- The subscriptionpublic void deleteSubscription(Long subId) throws org.ofbiz.core.entity.GenericEntityException
deleteSubscription
in interface SubscriptionManager
org.ofbiz.core.entity.GenericEntityException
public void deleteSubscriptionsForUser(@Nonnull ApplicationUser user) throws org.ofbiz.core.entity.GenericEntityException
SubscriptionManager
deleteSubscriptionsForUser
in interface SubscriptionManager
user
- the current user performing this operationorg.ofbiz.core.entity.GenericEntityException
public void runSubscription(Long subId) throws org.ofbiz.core.entity.GenericEntityException
runSubscription
in interface SubscriptionManager
org.ofbiz.core.entity.GenericEntityException
public void runSubscription(ApplicationUser user, Long subId) throws org.ofbiz.core.entity.GenericEntityException
SubscriptionManager
runSubscription
in interface SubscriptionManager
user
- the current user performing this operationsubId
- identifies the subscription to updateorg.ofbiz.core.entity.GenericEntityException
public void deleteSubscriptionsForGroup(com.atlassian.crowd.embedded.api.Group group) throws org.ofbiz.core.entity.GenericEntityException
deleteSubscriptionsForGroup
in interface SubscriptionManager
org.ofbiz.core.entity.GenericEntityException
public boolean isGroupUsed(@Nonnull com.atlassian.crowd.embedded.api.Group group)
GroupConfigurable
Group
.isGroupUsed
in interface GroupConfigurable
group
- that may or may not exist.Copyright © 2002-2019 Atlassian. All Rights Reserved.