|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.bamboo.notification.NotificationManagerImpl
public class NotificationManagerImpl
Constructor Summary | |
---|---|
NotificationManagerImpl()
|
Method Summary | ||
---|---|---|
NotificationSet |
cloneNotificationSet(NotificationSet oldSet)
Clone notification set and rules for use when cloning Plan |
|
NotificationRule |
createNotificationRule(java.lang.Class<? extends NotificationType> notificationTypeClass,
java.lang.String conditionData,
java.lang.Class<? extends NotificationRecipient> recipientTypeClass,
java.lang.String recipientString)
Creates a new NotificationRule from the NotificationType and NotificationRecipient specificed. |
|
NotificationRule |
createNotificationRule(java.lang.String conditionKey,
java.lang.String conditionData,
java.lang.String recipientString,
java.lang.String recipientType)
Create notification rule and provide required managers. |
|
NotificationRule |
createNotificationRuleFromAction(java.lang.String notificationTypeKey,
java.lang.String notificationRecipientKey,
java.util.Map<java.lang.String,java.lang.String[]> actionParams)
Creates a notification rule based on the keys and params passed in from the action |
|
NotificationRule |
createNotificationRuleFromAction(java.lang.String notificationTypeKey,
java.lang.String notificationRecipientKey,
java.util.Map<java.lang.String,java.lang.String[]> actionParams,
boolean allowLegacyConditions)
Deprecated. |
|
NotificationSet |
createOrGetSystemNotificationSet()
Get the system notification set for this bamboo and if one doesn't exist create it! |
|
java.util.List<NotificationRecipient> |
getAllNotificationRecipients()
|
|
java.util.List<NotificationType> |
getAllNotificationTypes()
|
|
java.util.List<NotificationType> |
getChainNotificationTypes()
Return notification types marked explicitly as "chain" notification in plugin xml description |
|
NotificationRecipient |
getNotificationRecipientFromKey(java.lang.String notificationRecipientKey)
|
|
NotificationRule |
getNotificationRuleById(long notificationId)
Get a specific notification rule |
|
|
getNotificationRules(T plan)
Extract notification rules for a plan. |
|
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 |
|
java.util.List<NotificationSet> |
getNotificationSetsForType(NotificationSet.NotificationSetType type)
|
|
NotificationType |
getNotificationTypeFromKey(java.lang.String key)
Retrieve a specific NotificationType plugin module based on the given key. |
|
java.util.List<NotificationType> |
getPlanNotificationTypes()
|
|
java.util.List<NotificationType> |
getSystemNotificationTypes()
|
|
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 |
saveSystemNotificationRule(NotificationRule notificationRule)
Do not use this method. |
|
void |
setBambooUserManager(BambooUserManager bambooUserManager)
|
|
void |
setLabelManager(LabelManager labelManager)
|
|
void |
setNotificationDao(NotificationDao notificationRuleDao)
|
|
void |
setPluginAccessor(com.atlassian.plugin.PluginAccessor pluginAccessor)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NotificationManagerImpl()
Method Detail |
---|
public void saveNotificationSet(NotificationSet nSet)
NotificationManager
saveNotificationSet
in interface NotificationManager
nSet
- the notification set to savepublic NotificationRule createNotificationRule(java.lang.String conditionKey, java.lang.String conditionData, java.lang.String recipientString, java.lang.String recipientType)
NotificationManager
createNotificationRule
in interface NotificationManager
conditionKey
- - key representation of the notification typeconditionData
- - any data the notification type requiresrecipientString
- - data the recipient type requires (e.g user or group name)recipientType
- - key representing the type of recipient
@NotNull public NotificationRule createNotificationRule(@NotNull java.lang.Class<? extends NotificationType> notificationTypeClass, @Nullable java.lang.String conditionData, @NotNull java.lang.Class<? extends NotificationRecipient> recipientTypeClass, @Nullable java.lang.String recipientString)
NotificationManager
NotificationRule
from the NotificationType
and NotificationRecipient
specificed.
createNotificationRule
in interface NotificationManager
notificationTypeClass
- NotificationType
conditionData
- - any data the notification type requiresrecipientTypeClass
- NotificationRecipient
recipientString
- - data the recipient type requires (e.g user or group name)
@Deprecated @NotNull public NotificationRule createNotificationRuleFromAction(java.lang.String notificationTypeKey, java.lang.String notificationRecipientKey, java.util.Map<java.lang.String,java.lang.String[]> actionParams, boolean allowLegacyConditions) throws java.lang.IllegalArgumentException
NotificationManager
createNotificationRuleFromAction
in interface NotificationManager
notificationTypeKey
- - the plugin key for the notification type selectednotificationRecipientKey
- - the plugin key for the notification recipient type selectedactionParams
- - the action params.allowLegacyConditions
- - @deprecated, does nothing
java.lang.IllegalArgumentException
- if either of the keys provided is invalid@NotNull public NotificationRule createNotificationRuleFromAction(java.lang.String notificationTypeKey, java.lang.String notificationRecipientKey, java.util.Map<java.lang.String,java.lang.String[]> actionParams) throws java.lang.IllegalArgumentException
NotificationManager
createNotificationRuleFromAction
in interface NotificationManager
notificationTypeKey
- - the plugin key for the notification type selectednotificationRecipientKey
- - the plugin key for the notification recipient type selectedactionParams
- - the action params.
java.lang.IllegalArgumentException
- if either of the keys provided is invalid@NotNull public <T extends Plan> java.util.Set<NotificationRule> getNotificationRules(@Nullable T plan)
NotificationManager
getNotificationRules
in interface NotificationManager
plan
- to get notifications for
public NotificationSet cloneNotificationSet(NotificationSet oldSet)
NotificationManager
Plan
cloneNotificationSet
in interface NotificationManager
oldSet
- - the notification set to clone
@NotNull public java.util.List<NotificationSet> getNotificationSetsForType(NotificationSet.NotificationSetType type)
public java.util.List<NotificationType> getAllNotificationTypes()
getAllNotificationTypes
in interface NotificationManager
NotificationType
plugin modules regardless of scope.public java.util.List<NotificationType> getSystemNotificationTypes()
getSystemNotificationTypes
in interface NotificationManager
NotificationType
plugin modules which have the "system" scopepublic java.util.List<NotificationType> getPlanNotificationTypes()
getPlanNotificationTypes
in interface NotificationManager
NotificationType
plugin modules which have the "plan" scopepublic java.util.List<NotificationType> getChainNotificationTypes()
NotificationManager
getChainNotificationTypes
in interface NotificationManager
NotificationType
plugin modules which have the "chain" scopepublic java.util.List<NotificationRecipient> getAllNotificationRecipients()
getAllNotificationRecipients
in interface NotificationManager
NotificationRecipient
plugin modulespublic NotificationRecipient getNotificationRecipientFromKey(java.lang.String notificationRecipientKey)
getNotificationRecipientFromKey
in interface NotificationManager
notificationRecipientKey
- represntenting the NotificationRecipient required
NotificationRecipient
plugin module based on the given key.@Nullable public NotificationType getNotificationTypeFromKey(java.lang.String key)
NotificationManager
NotificationType
plugin module based on the given key.
getNotificationTypeFromKey
in interface NotificationManager
key
- of the notification type
NotificationType
plugin module based on the given key.@NotNull public java.util.List<UsersNotification> getNotificationRulesForUser(@NotNull BambooUser user)
NotificationManager
getNotificationRulesForUser
in interface NotificationManager
user
- BambooUser to look up notifications for
public boolean isRecipientUserBase(NotificationRule notificationRule)
NotificationManager
isRecipientUserBase
in interface NotificationManager
notificationRule
- to check
@NotNull public NotificationSet createOrGetSystemNotificationSet()
NotificationManager
createOrGetSystemNotificationSet
in interface NotificationManager
public void saveSystemNotificationRule(@NotNull NotificationRule notificationRule)
NotificationManager
saveSystemNotificationRule
in interface NotificationManager
notificationRule
- to be added@Nullable public NotificationRule getNotificationRuleById(long notificationId)
NotificationManager
getNotificationRuleById
in interface NotificationManager
notificationId
- of the notification to get.
public void setNotificationDao(NotificationDao notificationRuleDao)
public void setPluginAccessor(com.atlassian.plugin.PluginAccessor pluginAccessor)
public void setBambooUserManager(BambooUserManager bambooUserManager)
public void setLabelManager(LabelManager labelManager)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |