com.atlassian.bamboo.notification.conditions
Class AbstractNotificationCondition

java.lang.Object
  extended by com.atlassian.bamboo.notification.conditions.AbstractNotificationCondition
All Implemented Interfaces:
NotificationCondition, BambooPluginModule
Direct Known Subclasses:
AllBuildsCondition, BuildFailedandFirstFixedCondition

public abstract class AbstractNotificationCondition
extends java.lang.Object
implements NotificationCondition


Constructor Summary
AbstractNotificationCondition()
           
 
Method Summary
 java.lang.String getConfigurationData()
          Returns the string representation of the configurable data in the condition objext to be persisted
 java.lang.String getEditHtml()
          Returns the html to be displayed on the edit screen (to input data into condition)
 com.atlassian.mail.Email getTextEmail(com.atlassian.event.Event event, com.atlassian.mail.Email email)
          Takes in email object and sets body, subject and mimeType (and any other details you want eg.
 java.lang.String getViewHtml()
          Returns the HTML representing the condition object for the notification
 void init(com.atlassian.plugin.ModuleDescriptor moduleDescriptor)
          initialises the condition object with its module descriptor
 void init(java.lang.String data)
          initalises the condition object with data based on the config xml string
 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
 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.NotificationCondition
getDescription, getEmailSubject, getIMContent, getKey, isNotificationRequired
 

Constructor Detail

AbstractNotificationCondition

public AbstractNotificationCondition()
Method Detail

init

public void init(@Nullable
                 java.lang.String data)
Description copied from interface: NotificationCondition
initalises the condition object with data based on the config xml string

Specified by:
init in interface NotificationCondition
Parameters:
data - string representation of configurable data

init

public void init(@NotNull
                 com.atlassian.plugin.ModuleDescriptor moduleDescriptor)
Description copied from interface: NotificationCondition
initialises the condition object with its module descriptor

Specified by:
init in interface NotificationCondition
Parameters:
moduleDescriptor - for this plugin object

getConfigurationData

@NotNull
public java.lang.String getConfigurationData()
Description copied from interface: NotificationCondition
Returns the string representation of the configurable data in the condition objext to be persisted

Specified by:
getConfigurationData in interface NotificationCondition
Returns:
String of config data. Empty string if no config data

getEditHtml

@NotNull
public java.lang.String getEditHtml()
Description copied from interface: NotificationCondition
Returns the html to be displayed on the edit screen (to input data into condition)

Specified by:
getEditHtml in interface NotificationCondition
Returns:
String of html

getViewHtml

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

Specified by:
getViewHtml in interface NotificationCondition
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: NotificationCondition
validate the user inputed data

Specified by:
validate in interface NotificationCondition
Parameters:
params - map of key (String), value (String []) pairs from action
Returns:
error collection of any errors

populate

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

Specified by:
populate in interface NotificationCondition
Parameters:
config - map of key (String), value (String []) pairs from action

getTextEmail

public com.atlassian.mail.Email getTextEmail(@NotNull
                                             com.atlassian.event.Event event,
                                             @NotNull
                                             com.atlassian.mail.Email email)
                                      throws java.lang.Exception
Description copied from interface: NotificationCondition
Takes in email object and sets body, subject and mimeType (and any other details you want eg. attachments).

Specified by:
getTextEmail in interface NotificationCondition
Parameters:
event - Event Object (eg BuildCompletedEvent) that the notification is fired on
email - Email object for condition to add body and attachments etc
Returns:
Email with content
Throws:
java.lang.Exception - if there is a problem preventing production of the e-mail.


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.