Class AbstractNotificationType
- java.lang.Object
-
- com.atlassian.bamboo.notification.AbstractNotificationType
-
- All Implemented Interfaces:
NotificationType,BambooPluginModule,Comparable
- Direct Known Subclasses:
AfterXFailedNotificationType,AllBuildsNotificationType,AllChainNotificationType,AllStageNotificationType,BuildErrorNotificationType,BuildFailedAndFirstFixedNotificationType,BuildHungNotificationType,BuildMissingCapableAgentNotificationType,BuildQueueTimeoutNotificationType,BuildStatusChangeNotificationType,ChainStatusChangeNotificationType,ChangeInResponsibilityNotificationType,CommentNotificationType,DeploymentFailedNotificationType,DeploymentFinishedNotificationType,DeploymentStartedFinishedNotificationType,FirstJobFailedNotificationType
public abstract class AbstractNotificationType extends Object implements NotificationType
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.atlassian.bamboo.notification.NotificationType
NotificationType.Scope
-
-
Field Summary
Fields Modifier and Type Field Description protected NotificationTypeModuleDescriptornotificationTypeModuleDescriptor
-
Constructor Summary
Constructors Constructor Description AbstractNotificationType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(Object o)@NotNull StringgetConfigurationData()Returns the string representation of the configurable data of the notification type to be persisted to the db@NotNull StringgetDescription()Returns generic string description of this notification type@NotNull StringgetEditHtml()Returns the html to be displayed on the edit screen (to input data into notification type)@NotNull StringgetKey()returns key for this condition object@Nullable com.atlassian.plugin.web.descriptors.WeightedDescriptorgetModuleDescriptor()returns the moduleDescriptor for this plugin object if it exists.@NotNull StringgetName()Returns a short name of the notification typeNotificationType.ScopegetScope()@NotNull StringgetViewHtml()Returns the HTML representing the notification type for the notificationvoidinit(@NotNull com.atlassian.plugin.web.descriptors.WeightedDescriptor moduleDescriptor)initialises the notification type plugin object with its module descriptorbooleanisNotificationRequired(@NotNull Object event)Determines whether or not a notification should be sent based on the event.voidpopulate(@NotNull Map<String,String[]> config)takes the map of config data from action and extracts the parameters it needsvoidsetConfigurationData(@Nullable String data)initalises the notification type object with its data based on the config string retrieved from the database@NotNull ErrorCollectionvalidate(@NotNull Map<String,String[]> params)validate the user inputed data
-
-
-
Field Detail
-
notificationTypeModuleDescriptor
protected NotificationTypeModuleDescriptor notificationTypeModuleDescriptor
-
-
Method Detail
-
setConfigurationData
public void setConfigurationData(@Nullable @Nullable String data)Description copied from interface:NotificationTypeinitalises the notification type object with its data based on the config string retrieved from the database- Specified by:
setConfigurationDatain interfaceNotificationType- Parameters:
data- string representation of configurable data
-
isNotificationRequired
public boolean isNotificationRequired(@NotNull @NotNull Object event)Description copied from interface:NotificationTypeDetermines whether or not a notification should be sent based on the event. Can look for context specific information as well as user configuration.- Specified by:
isNotificationRequiredin interfaceNotificationType- Returns:
- true or false - to send or not to send.
-
init
public void init(@NotNull @NotNull com.atlassian.plugin.web.descriptors.WeightedDescriptor moduleDescriptor)Description copied from interface:NotificationTypeinitialises the notification type plugin object with its module descriptor- Specified by:
initin interfaceNotificationType- Parameters:
moduleDescriptor- for this plugin object
-
getModuleDescriptor
@Nullable public @Nullable com.atlassian.plugin.web.descriptors.WeightedDescriptor getModuleDescriptor()
Description copied from interface:NotificationTypereturns the moduleDescriptor for this plugin object if it exists.- Specified by:
getModuleDescriptorin interfaceNotificationType- Returns:
-
getKey
@NotNull public @NotNull String getKey()
Description copied from interface:NotificationTypereturns key for this condition object- Specified by:
getKeyin interfaceNotificationType- Returns:
- string key (as in plugin definition), can not be null
-
getName
@NotNull public @NotNull String getName()
Description copied from interface:NotificationTypeReturns a short name of the notification type- Specified by:
getNamein interfaceNotificationType- Returns:
-
getDescription
@NotNull public @NotNull String getDescription()
Description copied from interface:NotificationTypeReturns generic string description of this notification type- Specified by:
getDescriptionin interfaceNotificationType- Returns:
- string description - can not be null
-
getScope
public NotificationType.Scope getScope()
- Specified by:
getScopein interfaceNotificationType- Returns:
- The scope of the notification type, e.g. "plan" or "system" or "chain" or "deployment".
-
getConfigurationData
@NotNull public @NotNull String getConfigurationData()
Description copied from interface:NotificationTypeReturns the string representation of the configurable data of the notification type to be persisted to the db- Specified by:
getConfigurationDatain interfaceNotificationType- Returns:
- String of config data. Empty string if no config data
-
getEditHtml
@NotNull public @NotNull String getEditHtml()
Description copied from interface:NotificationTypeReturns the html to be displayed on the edit screen (to input data into notification type)- Specified by:
getEditHtmlin interfaceNotificationType- Returns:
- String of html
-
getViewHtml
@NotNull public @NotNull String getViewHtml()
Description copied from interface:NotificationTypeReturns the HTML representing the notification type for the notification- Specified by:
getViewHtmlin interfaceNotificationType- Returns:
- HTML of data for view configuration. If this returns null the description will be used.
-
validate
@NotNull public @NotNull ErrorCollection validate(@NotNull @NotNull Map<String,String[]> params)
Description copied from interface:NotificationTypevalidate the user inputed data- Specified by:
validatein interfaceNotificationType- Parameters:
params- map of key (String), value (String []) pairs from action- Returns:
- error collection of any errors to be reported back to the user
-
populate
public void populate(@NotNull @NotNull Map<String,String[]> config)Description copied from interface:NotificationTypetakes the map of config data from action and extracts the parameters it needs- Specified by:
populatein interfaceNotificationType- Parameters:
config- map of key (String), value (String []) pairs from action
-
compareTo
public int compareTo(Object o)
- Specified by:
compareToin interfaceComparable
-
-