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 NotificationTypeModuleDescriptor
notificationTypeModuleDescriptor
-
Constructor Summary
Constructors Constructor Description AbstractNotificationType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Object o)
@NotNull String
getConfigurationData()
Returns the string representation of the configurable data of the notification type to be persisted to the db@NotNull String
getDescription()
Returns generic string description of this notification type@NotNull String
getEditHtml()
Returns the html to be displayed on the edit screen (to input data into notification type)@NotNull String
getKey()
returns key for this condition object@Nullable com.atlassian.plugin.web.descriptors.WeightedDescriptor
getModuleDescriptor()
returns the moduleDescriptor for this plugin object if it exists.@NotNull String
getName()
Returns a short name of the notification typeNotificationType.Scope
getScope()
@NotNull String
getViewHtml()
Returns the HTML representing the notification type for the notificationvoid
init(@NotNull com.atlassian.plugin.web.descriptors.WeightedDescriptor moduleDescriptor)
initialises the notification type plugin object with its module descriptorboolean
isNotificationRequired(@NotNull Object event)
Determines whether or not a notification should be sent based on the event.void
populate(@NotNull Map<String,String[]> config)
takes the map of config data from action and extracts the parameters it needsvoid
setConfigurationData(@Nullable String data)
initalises the notification type object with its data based on the config string retrieved from the database@NotNull ErrorCollection
validate(@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:NotificationType
initalises the notification type object with its data based on the config string retrieved from the database- Specified by:
setConfigurationData
in interfaceNotificationType
- Parameters:
data
- string representation of configurable data
-
isNotificationRequired
public boolean isNotificationRequired(@NotNull @NotNull Object event)
Description copied from interface:NotificationType
Determines 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:
isNotificationRequired
in 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:NotificationType
initialises the notification type plugin object with its module descriptor- Specified by:
init
in interfaceNotificationType
- Parameters:
moduleDescriptor
- for this plugin object
-
getModuleDescriptor
@Nullable public @Nullable com.atlassian.plugin.web.descriptors.WeightedDescriptor getModuleDescriptor()
Description copied from interface:NotificationType
returns the moduleDescriptor for this plugin object if it exists.- Specified by:
getModuleDescriptor
in interfaceNotificationType
- Returns:
-
getKey
@NotNull public @NotNull String getKey()
Description copied from interface:NotificationType
returns key for this condition object- Specified by:
getKey
in interfaceNotificationType
- Returns:
- string key (as in plugin definition), can not be null
-
getName
@NotNull public @NotNull String getName()
Description copied from interface:NotificationType
Returns a short name of the notification type- Specified by:
getName
in interfaceNotificationType
- Returns:
-
getDescription
@NotNull public @NotNull String getDescription()
Description copied from interface:NotificationType
Returns generic string description of this notification type- Specified by:
getDescription
in interfaceNotificationType
- Returns:
- string description - can not be null
-
getScope
public NotificationType.Scope getScope()
- Specified by:
getScope
in 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:NotificationType
Returns the string representation of the configurable data of the notification type to be persisted to the db- Specified by:
getConfigurationData
in interfaceNotificationType
- Returns:
- String of config data. Empty string if no config data
-
getEditHtml
@NotNull public @NotNull String getEditHtml()
Description copied from interface:NotificationType
Returns the html to be displayed on the edit screen (to input data into notification type)- Specified by:
getEditHtml
in interfaceNotificationType
- Returns:
- String of html
-
getViewHtml
@NotNull public @NotNull String getViewHtml()
Description copied from interface:NotificationType
Returns the HTML representing the notification type for the notification- Specified by:
getViewHtml
in 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:NotificationType
validate the user inputed data- Specified by:
validate
in 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:NotificationType
takes the map of config data from action and extracts the parameters it needs- Specified by:
populate
in interfaceNotificationType
- Parameters:
config
- map of key (String), value (String []) pairs from action
-
compareTo
public int compareTo(Object o)
- Specified by:
compareTo
in interfaceComparable
-
-