com.atlassian.bamboo.notification
Interface NotificationType

All Superinterfaces:
BambooPluginModule, java.lang.Comparable
All Known Implementing Classes:
AbstractNotificationType, AfterXFailedNotificationType, AllBuildsNotificationType, AllChainNotificationType, AllStageNotificationType, BuildErrorNotificationType, BuildFailedAndFirstFixedNotificationType, BuildHungNotificationType, BuildMissingCapableAgentNotificationType, BuildQueueTimeoutNotificationType, BuildStatusChangeNotificationType, ChainFailedAndFirstFixedNotificationType, ChainStatusChangeNotificationType, CommentNotificationType, FirstJobFailedNotificationType

public interface NotificationType
extends BambooPluginModule, java.lang.Comparable

Represents a type of notification. This is used for the creation of notification rules and determining if the notification should be sent.


Nested Class Summary
static class NotificationType.Scope
           
 
Method Summary
 java.lang.String getConfigurationData()
          Returns the string representation of the configurable data of the notification type to be persisted to the db
 java.lang.String getDescription()
          Returns generic string description of this notification type
 java.lang.String getEditHtml()
          Returns the html to be displayed on the edit screen (to input data into notification type)
 java.lang.String getKey()
          returns key for this condition object
 com.atlassian.plugin.web.descriptors.WeightedDescriptor getModuleDescriptor()
          returns the moduleDescriptor for this plugin object if it exists.
 java.lang.String getName()
          Returns a short name of the notification type
 NotificationType.Scope getScope()
          The scope of the notification type be it "plan" or "system" or "chain"
 java.lang.String getViewHtml()
          Returns the HTML representing the notification type for the notification
 void init(com.atlassian.plugin.web.descriptors.WeightedDescriptor moduleDescriptor)
          initialises the notification type plugin object with its module descriptor
 boolean isNotificationRequired(com.atlassian.event.Event event)
          Determines whether or not a notification should be sent based on the event.
 void populate(java.util.Map<java.lang.String,java.lang.String[]> params)
          takes the map of config data from action and extracts the parameters it needs
 void setConfigurationData(java.lang.String data)
          initalises the notification type object with its data based on the config string retrieved from the database
 ErrorCollection validate(java.util.Map<java.lang.String,java.lang.String[]> params)
          validate the user inputed data
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

init

void init(@NotNull
          com.atlassian.plugin.web.descriptors.WeightedDescriptor moduleDescriptor)
initialises the notification type plugin object with its module descriptor

Parameters:
moduleDescriptor - for this plugin object

getModuleDescriptor

@Nullable
com.atlassian.plugin.web.descriptors.WeightedDescriptor getModuleDescriptor()
returns the moduleDescriptor for this plugin object if it exists.

Returns:

setConfigurationData

void setConfigurationData(@Nullable
                          java.lang.String data)
initalises the notification type object with its data based on the config string retrieved from the database

Parameters:
data - string representation of configurable data

getConfigurationData

@NotNull
java.lang.String getConfigurationData()
Returns the string representation of the configurable data of the notification type to be persisted to the db

Returns:
String of config data. Empty string if no config data

getName

@NotNull
java.lang.String getName()
Returns a short name of the notification type

Returns:

getDescription

@NotNull
java.lang.String getDescription()
Returns generic string description of this notification type

Returns:
string description - can not be null

getKey

@NotNull
java.lang.String getKey()
returns key for this condition object

Returns:
string key (as in plugin definition), can not be null

populate

void populate(@NotNull
              java.util.Map<java.lang.String,java.lang.String[]> params)
takes the map of config data from action and extracts the parameters it needs

Parameters:
params - map of key (String), value (String []) pairs from action

validate

@NotNull
ErrorCollection validate(@NotNull
                                 java.util.Map<java.lang.String,java.lang.String[]> params)
validate the user inputed data

Parameters:
params - map of key (String), value (String []) pairs from action
Returns:
error collection of any errors to be reported back to the user

getEditHtml

@NotNull
java.lang.String getEditHtml()
Returns the html to be displayed on the edit screen (to input data into notification type)

Returns:
String of html

getViewHtml

@NotNull
java.lang.String getViewHtml()
Returns the HTML representing the notification type for the notification

Returns:
HTML of data for view configuration. If this returns null the description will be used.

isNotificationRequired

boolean isNotificationRequired(@NotNull
                               com.atlassian.event.Event event)
Determines whether or not a notification should be sent based on the event. Can look for context specific information as well as user configuration.

Parameters:
event -
Returns:
true or false - to send or not to send.

getScope

NotificationType.Scope getScope()
The scope of the notification type be it "plan" or "system" or "chain"

Returns:
The scope of the notification type be it "plan" or "system" or "chain"


Copyright © 2011 Atlassian. All Rights Reserved.