com.atlassian.bamboo.notification.conditions
Class AfterXFailedBuildsCondition

java.lang.Object
  extended by com.atlassian.bamboo.notification.conditions.AfterXFailedBuildsCondition
All Implemented Interfaces:
NotificationCondition, BambooPluginModule

public class AfterXFailedBuildsCondition
extends java.lang.Object
implements NotificationCondition


Field Summary
static java.lang.String DESCRIPTION
           
static java.lang.String KEY
           
static java.lang.String TEXT_EMAIL_TEMPLATE
           
 
Constructor Summary
AfterXFailedBuildsCondition()
           
 
Method Summary
 java.lang.String getConfigurationData()
          Returns the string representation of the configurable data in the condition objext to be persisted
 java.lang.String getDescription()
          Returns generic string description of this condition
 java.lang.String getEditHtml()
          Returns the html to be displayed on the edit screen (to input data into condition)
 java.lang.String getEmailSubject(com.atlassian.event.Event event)
           
 java.lang.String getIMContent(com.atlassian.event.Event event)
           
 java.lang.String getKey()
          returns key for this condition object
 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.
 org.apache.velocity.app.VelocityEngine getVelocityEngine()
           
 java.lang.String getViewHtml()
          Returns the HTML representing the condition object for the notification
 java.io.Writer getWriter()
           
 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
 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[]> config)
          takes the map of config data from action and extracts the parameters it needs
 void setExtendedAuthorManager(ExtendedAuthorManager extendedAuthorManager)
           
 void setTemplateRenderer(TemplateRenderer templateRenderer)
           
 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
 

Field Detail

DESCRIPTION

public static final java.lang.String DESCRIPTION
See Also:
Constant Field Values

KEY

public static final java.lang.String KEY
See Also:
Constant Field Values

TEXT_EMAIL_TEMPLATE

public static final java.lang.String TEXT_EMAIL_TEMPLATE
See Also:
Constant Field Values
Constructor Detail

AfterXFailedBuildsCondition

public AfterXFailedBuildsCondition()
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

isNotificationRequired

public boolean isNotificationRequired(@NotNull
                                      com.atlassian.event.Event event)
Description copied from interface: NotificationCondition
determines whether or not a notification should be sent based on the event

Specified by:
isNotificationRequired in interface NotificationCondition
Returns:
true or false - to send or not to send.

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

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

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.

getTextEmail

public com.atlassian.mail.Email getTextEmail(@NotNull
                                             com.atlassian.event.Event event,
                                             @NotNull
                                             com.atlassian.mail.Email email)
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

getIMContent

@NotNull
public java.lang.String getIMContent(@NotNull
                                             com.atlassian.event.Event event)
Specified by:
getIMContent in interface NotificationCondition
Parameters:
event - Event Object that the notification is fired based on
Returns:
string im message

getEmailSubject

@NotNull
public java.lang.String getEmailSubject(@NotNull
                                                com.atlassian.event.Event event)
Specified by:
getEmailSubject in interface NotificationCondition
Parameters:
event - Event Object that the notification is fired based on
Returns:
String subject for emails.

getDescription

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

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

getKey

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

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

setTemplateRenderer

public void setTemplateRenderer(TemplateRenderer templateRenderer)

setExtendedAuthorManager

public void setExtendedAuthorManager(ExtendedAuthorManager extendedAuthorManager)

getWriter

public java.io.Writer getWriter()

getVelocityEngine

public org.apache.velocity.app.VelocityEngine getVelocityEngine()


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.