@PublicApi
public interface SubscriptionManager
Modifier and Type | Field and Description |
---|---|
static String |
SUBSCRIPTION_IDENTIFIER |
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.
|
boolean |
hasSubscription(ApplicationUser user,
Long filterId) |
void |
runSubscription(ApplicationUser user,
Long subId)
Run this subscription now.
|
void |
runSubscription(Long subId) |
void |
updateSubscription(ApplicationUser user,
Long subscriptionId,
String groupName,
String cronExpression,
Boolean emailOnEmpty) |
static final String SUBSCRIPTION_IDENTIFIER
boolean hasSubscription(ApplicationUser user, Long filterId) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
FilterSubscription getFilterSubscription(ApplicationUser user, Long subId) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
List<FilterSubscription> getFilterSubscriptions(ApplicationUser user, Long filterId) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
FilterSubscription createSubscription(ApplicationUser user, Long filterId, String groupName, String cronExpression, Boolean emailOnEmpty)
user
- the current user performing this operationfilterId
- Id of the filter subscribing togroupName
- Sent ot groupcronExpression
- The Cron expression for the subscriptionemailOnEmpty
- send email if filter returns no resultsvoid deleteSubscription(Long subId) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
void runSubscription(Long subId) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
void runSubscription(ApplicationUser user, Long subId) throws org.ofbiz.core.entity.GenericEntityException
user
- the current user performing this operationsubId
- identifies the subscription to updateorg.ofbiz.core.entity.GenericEntityException
FilterSubscription getFilterSubscription(Long subId) throws org.ofbiz.core.entity.GenericEntityException
subId
- Subscription Idorg.ofbiz.core.entity.GenericEntityException
void updateSubscription(ApplicationUser user, Long subscriptionId, String groupName, String cronExpression, Boolean emailOnEmpty) throws DataAccessException
user
- the current user performing this operationsubscriptionId
- 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.List<FilterSubscription> getAllFilterSubscriptions(Long filterId)
List<FilterSubscription> getAllFilterSubscriptions()
void deleteSubscriptionsForUser(ApplicationUser user) throws org.ofbiz.core.entity.GenericEntityException
user
- the current user performing this operationorg.ofbiz.core.entity.GenericEntityException
void deleteSubscriptionsForGroup(com.atlassian.crowd.embedded.api.Group group) throws org.ofbiz.core.entity.GenericEntityException
org.ofbiz.core.entity.GenericEntityException
String getCronExpressionForSubscription(FilterSubscription subscription)
subscription
- @Nullable Date getNextSendTime(@Nonnull FilterSubscription sub)
sub
- The subscriptionCopyright © 2002-2017 Atlassian. All Rights Reserved.