com.atlassian.bamboo.notification
Class AbstractNotificationType

java.lang.Object
  extended by com.atlassian.bamboo.notification.AbstractNotificationType
All Implemented Interfaces:
NotificationType, BambooPluginModule, java.lang.Comparable
Direct Known Subclasses:
AfterXFailedNotificationType, AllBuildsNotificationType, AllChainNotificationType, AllStageNotificationType, BuildErrorNotificationType, BuildFailedAndFirstFixedNotificationType, BuildHungNotificationType, BuildMissingCapableAgentNotificationType, BuildQueueTimeoutNotificationType, BuildStatusChangeNotifactionType, ChainStatusChangeNotifactionType, CommentNotificationType

public abstract class AbstractNotificationType
extends java.lang.Object
implements NotificationType


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.bamboo.notification.NotificationType
NotificationType.Scope
 
Field Summary
protected  NotificationTypeModuleDescriptor notificationTypeModuleDescriptor
           
 
Constructor Summary
AbstractNotificationType()
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 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.
 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
 void populate(java.util.Map<java.lang.String,java.lang.String[]> config)
          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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.bamboo.notification.NotificationType
isNotificationRequired
 

Field Detail

notificationTypeModuleDescriptor

protected NotificationTypeModuleDescriptor notificationTypeModuleDescriptor
Constructor Detail

AbstractNotificationType

public AbstractNotificationType()
Method Detail

setConfigurationData

public void setConfigurationData(@Nullable
                                 java.lang.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 interface NotificationType
Parameters:
data - string representation of configurable data

init

public void init(@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 interface NotificationType
Parameters:
moduleDescriptor - for this plugin object

getModuleDescriptor

@Nullable
public 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 interface NotificationType
Returns:

getKey

@NotNull
public java.lang.String getKey()
Description copied from interface: NotificationType
returns key for this condition object

Specified by:
getKey in interface NotificationType
Returns:
string key (as in plugin definition), can not be null

getDescription

@NotNull
public java.lang.String getDescription()
Description copied from interface: NotificationType
Returns generic string description of this notification type

Specified by:
getDescription in interface NotificationType
Returns:
string description - can not be null

getScope

public NotificationType.Scope getScope()
Description copied from interface: NotificationType
The scope of the notification type be it "plan" or "system" or "chain"

Specified by:
getScope in interface NotificationType
Returns:
The scope of the notification type be it "plan" or "system" or "chain"

getConfigurationData

@NotNull
public java.lang.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 interface NotificationType
Returns:
String of config data. Empty string if no config data

getEditHtml

@NotNull
public java.lang.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 interface NotificationType
Returns:
String of html

getViewHtml

@NotNull
public java.lang.String getViewHtml()
Description copied from interface: NotificationType
Returns the HTML representing the notification type for the notification

Specified by:
getViewHtml in interface NotificationType
Returns:
HTML of data for view configuration. If this returns null the description will be used.

validate

@NotNull
public ErrorCollection validate(@NotNull
                                        java.util.Map<java.lang.String,java.lang.String[]> params)
Description copied from interface: NotificationType
validate the user inputed data

Specified by:
validate in interface NotificationType
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
                     java.util.Map<java.lang.String,java.lang.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 interface NotificationType
Parameters:
config - map of key (String), value (String []) pairs from action

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable


Copyright © 2010 Atlassian. All Rights Reserved.