com.atlassian.jira.issue.subscription
Class DefaultSubscriptionManager

java.lang.Object
  extended by com.atlassian.jira.mail.MailingListCompiler
      extended by com.atlassian.jira.issue.subscription.DefaultSubscriptionManager
All Implemented Interfaces:
SubscriptionManager

public class DefaultSubscriptionManager
extends MailingListCompiler
implements SubscriptionManager


Field Summary
static String SUBSCRIPTION_IDENTIFIER
           
static String SUBSCRIPTION_PREFIX
           
 
Constructor Summary
DefaultSubscriptionManager(OfBizDelegator delegator, org.quartz.Scheduler scheduler, com.atlassian.mail.queue.MailQueue mailQueue, TemplateManager templateManager, SubscriptionMailQueueItemFactory subscriptionMailQueueItemFactory, ProjectRoleManager projectRoleManager)
           
 
Method Summary
 org.ofbiz.core.entity.GenericValue createSubscription(User user, Long filterId, String groupName, Long period, Boolean emailOnEmpty)
           
 org.ofbiz.core.entity.GenericValue createSubscription(User user, Long filterId, String groupName, org.quartz.Trigger trigger, 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 deleteSubscriptionsForUser(User user)
           
 List getAllSubscriptions()
           
 List getAllSubscriptions(Long filterId)
           
 org.ofbiz.core.entity.GenericValue getSubscription(User user, Long subId)
           
 org.ofbiz.core.entity.GenericValue getSubscriptionFromTriggerName(String triggerName)
           
 List getSubscriptions(User user, Long filterId)
           
 org.quartz.Trigger getTriggerFromSubscription(org.ofbiz.core.entity.GenericValue subscription)
           
 boolean hasSubscription(User user, Long filterId)
           
 void runSubscription(org.ofbiz.core.entity.GenericValue sub)
           
 void runSubscription(User u, Long subId)
           
 void updateSubscription(User u, Long subId, Map fields, org.quartz.Trigger trigger)
          This will update the subscription identified by the subscription id to contain the details specifed in the fields map and it will update the trigger with the provided the Trigger.
 void updateSubscription(User user, Long subId, String groupName, org.quartz.Trigger trigger, Boolean emailOnEmpty)
           
 
Methods inherited from class com.atlassian.jira.mail.MailingListCompiler
getEmailAddresses, sendLists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUBSCRIPTION_PREFIX

public static final String SUBSCRIPTION_PREFIX
See Also:
Constant Field Values

SUBSCRIPTION_IDENTIFIER

public static final String SUBSCRIPTION_IDENTIFIER
See Also:
Constant Field Values
Constructor Detail

DefaultSubscriptionManager

public DefaultSubscriptionManager(OfBizDelegator delegator,
                                  org.quartz.Scheduler scheduler,
                                  com.atlassian.mail.queue.MailQueue mailQueue,
                                  TemplateManager templateManager,
                                  SubscriptionMailQueueItemFactory subscriptionMailQueueItemFactory,
                                  ProjectRoleManager projectRoleManager)
Method Detail

hasSubscription

public boolean hasSubscription(User user,
                               Long filterId)
                        throws org.ofbiz.core.entity.GenericEntityException
Specified by:
hasSubscription in interface SubscriptionManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getSubscription

public org.ofbiz.core.entity.GenericValue getSubscription(User user,
                                                          Long subId)
                                                   throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getSubscription in interface SubscriptionManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getSubscriptionFromTriggerName

public org.ofbiz.core.entity.GenericValue getSubscriptionFromTriggerName(String triggerName)
                                                                  throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getSubscriptionFromTriggerName in interface SubscriptionManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getSubscriptions

public List getSubscriptions(User user,
                             Long filterId)
                      throws org.ofbiz.core.entity.GenericEntityException
Specified by:
getSubscriptions in interface SubscriptionManager
Throws:
org.ofbiz.core.entity.GenericEntityException

getTriggerFromSubscription

public org.quartz.Trigger getTriggerFromSubscription(org.ofbiz.core.entity.GenericValue subscription)
                                              throws org.quartz.SchedulerException
Specified by:
getTriggerFromSubscription in interface SubscriptionManager
Throws:
org.quartz.SchedulerException

updateSubscription

public void updateSubscription(User u,
                               Long subId,
                               Map fields,
                               org.quartz.Trigger trigger)
                        throws DataAccessException
Description copied from interface: SubscriptionManager
This will update the subscription identified by the subscription id to contain the details specifed in the fields map and it will update the trigger with the provided the Trigger.

Specified by:
updateSubscription in interface SubscriptionManager
Parameters:
u - the current user performing this operation
subId - identifies the subscription to update
fields - the fields to update the subscription with.
trigger - The trigger to update the subscription with
Throws:
DataAccessException - if there is a problem persisting the data.

updateSubscription

public void updateSubscription(User user,
                               Long subId,
                               String groupName,
                               org.quartz.Trigger trigger,
                               Boolean emailOnEmpty)
                        throws DataAccessException
Specified by:
updateSubscription in interface SubscriptionManager
Parameters:
user - the current user performing this operation
subId - identifies the subscription to update
groupName - (optional) the name of the group to receive the email
trigger - The trigger to update the subscription with
Throws:
DataAccessException - if there is a problem persisting the data.

getAllSubscriptions

public List getAllSubscriptions(Long filterId)
Specified by:
getAllSubscriptions in interface SubscriptionManager

getAllSubscriptions

public List getAllSubscriptions()
Specified by:
getAllSubscriptions in interface SubscriptionManager

createSubscription

public org.ofbiz.core.entity.GenericValue createSubscription(User user,
                                                             Long filterId,
                                                             String groupName,
                                                             Long period,
                                                             Boolean emailOnEmpty)
Specified by:
createSubscription in interface SubscriptionManager

createSubscription

public org.ofbiz.core.entity.GenericValue createSubscription(User user,
                                                             Long filterId,
                                                             String groupName,
                                                             org.quartz.Trigger trigger,
                                                             Boolean emailOnEmpty)
Description copied from interface: SubscriptionManager
Creates a new subscription based on the passed in filter id and fired in accordance with the passed in trigger

Specified by:
createSubscription in interface SubscriptionManager
Parameters:
user - the current user performing this operation
filterId - Id of the filter subscribing to
groupName - Sent ot group
trigger - The trigger to store
emailOnEmpty - send email if filter returns no results
Returns:
GenericValue representing new subscription

deleteSubscription

public void deleteSubscription(Long subId)
                        throws Exception
Specified by:
deleteSubscription in interface SubscriptionManager
Throws:
Exception

deleteSubscriptionsForUser

public void deleteSubscriptionsForUser(User user)
                                throws Exception
Specified by:
deleteSubscriptionsForUser in interface SubscriptionManager
Throws:
Exception

runSubscription

public void runSubscription(org.ofbiz.core.entity.GenericValue sub)
                     throws Exception
Specified by:
runSubscription in interface SubscriptionManager
Throws:
Exception

runSubscription

public void runSubscription(User u,
                            Long subId)
                     throws Exception
Specified by:
runSubscription in interface SubscriptionManager
Throws:
Exception


Copyright © 2002-2007 Atlassian. All Rights Reserved.