Interface SubscriptionManager
- All Known Implementing Classes:
DefaultSubscriptionManager
@PublicApi
public interface SubscriptionManager
-
Field Summary
Fields -
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 triggervoid
deleteSubscription
(Long subId) void
deleteSubscriptionsForGroup
(com.atlassian.crowd.embedded.api.Group group) void
Delete 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 userboolean
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)
-
Field Details
-
SUBSCRIPTION_IDENTIFIER
- See Also:
-
-
Method Details
-
hasSubscription
boolean hasSubscription(ApplicationUser user, Long filterId) throws org.ofbiz.core.entity.GenericEntityException - Throws:
org.ofbiz.core.entity.GenericEntityException
-
getFilterSubscription
FilterSubscription getFilterSubscription(ApplicationUser user, Long subId) throws org.ofbiz.core.entity.GenericEntityException - Throws:
org.ofbiz.core.entity.GenericEntityException
-
getFilterSubscriptions
List<FilterSubscription> getFilterSubscriptions(ApplicationUser user, Long filterId) throws org.ofbiz.core.entity.GenericEntityException - Throws:
org.ofbiz.core.entity.GenericEntityException
-
createSubscription
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- 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
-
deleteSubscription
- Throws:
org.ofbiz.core.entity.GenericEntityException
-
runSubscription
- Throws:
org.ofbiz.core.entity.GenericEntityException
-
runSubscription
void runSubscription(ApplicationUser user, Long subId) throws org.ofbiz.core.entity.GenericEntityException Run this subscription now.- Parameters:
user
- the current user performing this operationsubId
- identifies the subscription to update- Throws:
org.ofbiz.core.entity.GenericEntityException
-
getFilterSubscription
FilterSubscription getFilterSubscription(Long subId) throws org.ofbiz.core.entity.GenericEntityException Get a subscription by Id- Parameters:
subId
- Subscription Id- Returns:
- Subscription
- Throws:
org.ofbiz.core.entity.GenericEntityException
- Since:
- v6.2
-
updateSubscription
void updateSubscription(ApplicationUser user, Long subscriptionId, String groupName, String cronExpression, Boolean emailOnEmpty) throws DataAccessException - Parameters:
user
- new owner for the subscriptionsubscriptionId
- 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
-
getAllFilterSubscriptions
List<FilterSubscription> getAllFilterSubscriptions() -
getSubscriptionsForUser
Get all subscriptions owned by the given user- Parameters:
user
- subscription owner or null for an anonymous user- Returns:
- list of subscriptions. Can be empty.
-
deleteSubscriptionsForUser
void deleteSubscriptionsForUser(ApplicationUser user) throws org.ofbiz.core.entity.GenericEntityException Delete all subscriptions owned by a user.- Parameters:
user
- the current user performing this operation- Throws:
org.ofbiz.core.entity.GenericEntityException
-
deleteSubscriptionsForGroup
void deleteSubscriptionsForGroup(com.atlassian.crowd.embedded.api.Group group) throws org.ofbiz.core.entity.GenericEntityException - Throws:
org.ofbiz.core.entity.GenericEntityException
-
getCronExpressionForSubscription
Retrieve the cron expression associated with this subscription- Parameters:
subscription
-- Returns:
- the cron expression associated with this subscription
-
getNextSendTime
Returns the next send time for this subscription. This may return null if the scheduler does not support the reporting of next send times.- Parameters:
sub
- The subscription- Returns:
- Next send time
-