Interface SubscriptionManager

All Known Implementing Classes:
DefaultSubscriptionManager

@PublicApi public interface SubscriptionManager
  • Field Details

  • 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 subscription
      filterId - Id of the filter subscribing to
      groupName - Sent ot group
      cronExpression - The Cron expression for the subscription
      emailOnEmpty - send email if filter returns no results
      Returns:
      FilterSubscription representing new subscription
    • deleteSubscription

      void deleteSubscription(Long subId) throws org.ofbiz.core.entity.GenericEntityException
      Throws:
      org.ofbiz.core.entity.GenericEntityException
    • runSubscription

      void runSubscription(Long subId) throws org.ofbiz.core.entity.GenericEntityException
      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 operation
      subId - 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 subscription
      subscriptionId - identifies the subscription to update
      groupName - (optional) the name of the group to receive the email
      cronExpression - The Cron expression to update the subscription with
      Throws:
      DataAccessException - if there is a problem persisting the data.
    • getAllFilterSubscriptions

      List<FilterSubscription> getAllFilterSubscriptions(Long filterId)
    • getAllFilterSubscriptions

      List<FilterSubscription> getAllFilterSubscriptions()
    • getSubscriptionsForUser

      @Nonnull List<FilterSubscription> getSubscriptionsForUser(@Nullable ApplicationUser user)
      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

      String getCronExpressionForSubscription(FilterSubscription subscription)
      Retrieve the cron expression associated with this subscription
      Parameters:
      subscription -
      Returns:
      the cron expression associated with this subscription
    • getNextSendTime

      @Nullable Date getNextSendTime(@Nonnull FilterSubscription sub)
      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