com.atlassian.bamboo.notification
Class NotificationManagerImpl

java.lang.Object
  extended by com.atlassian.bamboo.notification.NotificationManagerImpl
All Implemented Interfaces:
NotificationManager

public class NotificationManagerImpl
extends java.lang.Object
implements NotificationManager


Constructor Summary
NotificationManagerImpl()
           
 
Method Summary
 NotificationSet cloneNotificationSet(NotificationSet oldSet)
          Clone notification set and rules for use when cloning build
 NotificationRule createNotificationRule(NotificationSet notificationSet, java.lang.String conditionKey, java.lang.String conditionData, java.lang.String recipientString, java.lang.String recipientType)
          Create notification rule and provide required managers.
 java.util.List<NotificationCondition> getAllConditions()
          Deprecated. 
 java.util.List<NotificationRecipient> getAllNotificationRecipients()
          Returns a list of all enabled NotificationRecipient plugin modules
 java.util.List<NotificationType> getAllNotificationTypes()
          Returns a list of all enabled NotificationType plugin modules
 NotificationCondition getConditionFromKey(java.lang.String key)
          Deprecated. 
 NotificationRecipient getNotificationRecipientFromKey(java.lang.String notificationRecipientKey)
          Retrieve a specific NotificationRecipient plugin module based on the given key.
 java.util.Set<NotificationRule> getNotificationRules(Build build)
          Extract notification rules.
 java.util.List<UsersNotification> getNotificationRulesForUser(BambooUser user)
          Retrieves all notification rules associated with a given user searches for notification rules: * assigned to the user * assigned to a group the user belongs to * assigned to the user's email or user's im address * assigned to watchers of a build the user has marked as their favourite
 NotificationType getNotificationTypeFromKey(java.lang.String key)
          Retrieve a specific NotificationType plugin module based on the given key.
 java.util.Set<java.lang.String> getRecipientsFromString(java.lang.String recipientType, java.lang.String recipientString)
           
 boolean isRecipientUserBase(NotificationRule notificationRule)
          Determines whether or not a notification rule recipient evaluates to a bamboo user and therefore comply with the users notification preference.
 void saveNotificationSet(NotificationSet nSet)
          Saves a notification set without requiring a build.
 void setBambooUserManager(BambooUserManager bambooUserManager)
           
 void setLabelManager(LabelManager labelManager)
           
 void setNotificationDao(NotificationDao notificationRuleDao)
           
 void setPluginManager(com.atlassian.plugin.PluginManager pluginManager)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NotificationManagerImpl

public NotificationManagerImpl()
Method Detail

saveNotificationSet

public void saveNotificationSet(NotificationSet nSet)
Description copied from interface: NotificationManager
Saves a notification set without requiring a build.

Specified by:
saveNotificationSet in interface NotificationManager

createNotificationRule

public NotificationRule createNotificationRule(NotificationSet notificationSet,
                                               java.lang.String conditionKey,
                                               java.lang.String conditionData,
                                               java.lang.String recipientString,
                                               java.lang.String recipientType)
Description copied from interface: NotificationManager
Create notification rule and provide required managers.

Specified by:
createNotificationRule in interface NotificationManager
Parameters:
notificationSet - - the set the rule will belong to
Returns:

getRecipientsFromString

public java.util.Set<java.lang.String> getRecipientsFromString(java.lang.String recipientType,
                                                               java.lang.String recipientString)

getNotificationRules

@Nullable
public java.util.Set<NotificationRule> getNotificationRules(Build build)
Description copied from interface: NotificationManager
Extract notification rules. Currently this just grabs the set from the build however in future this may change to accomodate non build related rules.

Specified by:
getNotificationRules in interface NotificationManager
Returns:

cloneNotificationSet

public NotificationSet cloneNotificationSet(NotificationSet oldSet)
Description copied from interface: NotificationManager
Clone notification set and rules for use when cloning build

Specified by:
cloneNotificationSet in interface NotificationManager
Returns:

getAllConditions

@Deprecated
public java.util.List<NotificationCondition> getAllConditions()
Deprecated. 

Description copied from interface: NotificationManager
Returns a list of all enabled NotificationCondition plugin modules. This is deprecated and is only used to keep backward compatability for plugins. Use NotificationType instead.

Specified by:
getAllConditions in interface NotificationManager
Returns:

getAllNotificationTypes

public java.util.List<NotificationType> getAllNotificationTypes()
Description copied from interface: NotificationManager
Returns a list of all enabled NotificationType plugin modules

Specified by:
getAllNotificationTypes in interface NotificationManager
Returns:

getAllNotificationRecipients

public java.util.List<NotificationRecipient> getAllNotificationRecipients()
Description copied from interface: NotificationManager
Returns a list of all enabled NotificationRecipient plugin modules

Specified by:
getAllNotificationRecipients in interface NotificationManager
Returns:

getNotificationRecipientFromKey

public NotificationRecipient getNotificationRecipientFromKey(java.lang.String notificationRecipientKey)
Description copied from interface: NotificationManager
Retrieve a specific NotificationRecipient plugin module based on the given key.

Specified by:
getNotificationRecipientFromKey in interface NotificationManager
Returns:

getConditionFromKey

@Deprecated
@Nullable
public NotificationCondition getConditionFromKey(java.lang.String key)
Deprecated. 

Description copied from interface: NotificationManager
Retrieve an individual NotificationCondition plugin module based on the given key. This is deprecated and is only used to keep backward compatability for plugins. Use NotificationType instead.

Specified by:
getConditionFromKey in interface NotificationManager
Parameters:
key - - full plugin key for the module to be retrieved
Returns:

getNotificationTypeFromKey

@Nullable
public NotificationType getNotificationTypeFromKey(java.lang.String key)
Description copied from interface: NotificationManager
Retrieve a specific NotificationType plugin module based on the given key.

Specified by:
getNotificationTypeFromKey in interface NotificationManager
Returns:

getNotificationRulesForUser

@NotNull
public java.util.List<UsersNotification> getNotificationRulesForUser(@NotNull
                                                                             BambooUser user)
Description copied from interface: NotificationManager
Retrieves all notification rules associated with a given user searches for notification rules: * assigned to the user * assigned to a group the user belongs to * assigned to the user's email or user's im address * assigned to watchers of a build the user has marked as their favourite

Specified by:
getNotificationRulesForUser in interface NotificationManager
Returns:

isRecipientUserBase

public boolean isRecipientUserBase(NotificationRule notificationRule)
Description copied from interface: NotificationManager
Determines whether or not a notification rule recipient evaluates to a bamboo user and therefore comply with the users notification preference.

Specified by:
isRecipientUserBase in interface NotificationManager
Returns:
true if the recipient evaluates to a use

setNotificationDao

public void setNotificationDao(NotificationDao notificationRuleDao)

setPluginManager

public void setPluginManager(com.atlassian.plugin.PluginManager pluginManager)

setBambooUserManager

public void setBambooUserManager(BambooUserManager bambooUserManager)

setLabelManager

public void setLabelManager(LabelManager labelManager)


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.