com.atlassian.bamboo.notification
Interface NotificationCondition

All Superinterfaces:
BambooPluginModule
All Known Implementing Classes:
AbstractNotificationCondition, AfterXFailedBuildsCondition, AllBuildsCondition, BuildFailedandFirstFixedCondition

public interface NotificationCondition
extends BambooPluginModule


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.
 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
 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
 ErrorCollection validate(java.util.Map<java.lang.String,java.lang.String[]> params)
          validate the user inputed data
 

Method Detail

init

void init(@NotNull
          com.atlassian.plugin.ModuleDescriptor moduleDescriptor)
initialises the condition object with its module descriptor

Parameters:
moduleDescriptor - for this plugin object

init

void init(@Nullable
          java.lang.String data)
initalises the condition object with data based on the config xml string

Parameters:
data - string representation of configurable data

getDescription

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

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

getConfigurationData

@NotNull
java.lang.String getConfigurationData()
Returns the string representation of the configurable data in the condition objext to be persisted

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

populate

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

Parameters:
config - 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

getEditHtml

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

Returns:
String of html

getViewHtml

@NotNull
java.lang.String getViewHtml()
Returns the HTML representing the condition object 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

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

getTextEmail

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

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.

getIMContent

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

getEmailSubject

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


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.