com.atlassian.bamboo.notification.recipients
Class AbstractNotificationRecipient

java.lang.Object
  extended by com.atlassian.bamboo.notification.recipients.AbstractNotificationRecipient
All Implemented Interfaces:
NotificationRecipient, java.lang.Comparable
Direct Known Subclasses:
CommitterRecipient, EmailRecipient, GroupRecipient, ImRecipient, ResponsibleRecipient, UserRecipientImpl, WatcherRecipient

public abstract class AbstractNotificationRecipient
extends java.lang.Object
implements NotificationRecipient


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.atlassian.bamboo.notification.NotificationRecipient
NotificationRecipient.RequiresEvent, NotificationRecipient.RequiresPlan, NotificationRecipient.RequiresResultSummary, NotificationRecipient.UserRecipientExpandable
 
Field Summary
protected  NotificationRecipientModuleDescriptor notificationRecipientModuleDescriptor
           
 
Constructor Summary
AbstractNotificationRecipient()
           
 
Method Summary
 int compareTo(java.lang.Object o)
           
 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 full key for this condition object
 com.atlassian.plugin.web.descriptors.WeightedDescriptor getModuleDescriptor()
          returns the moduleDescriptor for this plugin object if it exists.
protected  java.lang.String getParam(java.lang.String param, java.util.Map<java.lang.String,java.lang.String[]> params)
           
 java.lang.String getRecipientConfig()
          Retrieve string representation of data - if none exists retrun empty string
protected  java.util.List<NotificationTransport> getTransports(java.util.Set<UserRecipient> userRecipients)
           
 java.lang.String getViewHtml()
          Returns the HTML representing the notification type for the notification
 void init(java.lang.String configurationData)
          Initialise recipient with string based represention of its configuration data
 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[]> params)
          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.NotificationRecipient
getTransports
 

Field Detail

notificationRecipientModuleDescriptor

protected NotificationRecipientModuleDescriptor notificationRecipientModuleDescriptor
Constructor Detail

AbstractNotificationRecipient

public AbstractNotificationRecipient()
Method Detail

init

public void init(@NotNull
                 com.atlassian.plugin.web.descriptors.WeightedDescriptor moduleDescriptor)
Description copied from interface: NotificationRecipient
initialises the notification type plugin object with its module descriptor

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

getModuleDescriptor

@Nullable
public com.atlassian.plugin.web.descriptors.WeightedDescriptor getModuleDescriptor()
Description copied from interface: NotificationRecipient
returns the moduleDescriptor for this plugin object if it exists.

Specified by:
getModuleDescriptor in interface NotificationRecipient
Returns:

getDescription

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

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

getKey

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

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

init

public void init(@Nullable
                 java.lang.String configurationData)
Description copied from interface: NotificationRecipient
Initialise recipient with string based represention of its configuration data

Specified by:
init in interface NotificationRecipient

getRecipientConfig

@NotNull
public java.lang.String getRecipientConfig()
Description copied from interface: NotificationRecipient
Retrieve string representation of data - if none exists retrun empty string

Specified by:
getRecipientConfig in interface NotificationRecipient
Returns:

populate

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

Specified by:
populate in interface NotificationRecipient
Parameters:
params - 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: NotificationRecipient
validate the user inputed data

Specified by:
validate in interface NotificationRecipient
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
public java.lang.String getEditHtml()
Description copied from interface: NotificationRecipient
Returns the html to be displayed on the edit screen (to input data into notification type)

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

getViewHtml

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

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

getParam

protected java.lang.String getParam(java.lang.String param,
                                    java.util.Map<java.lang.String,java.lang.String[]> params)

compareTo

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

getTransports

protected java.util.List<NotificationTransport> getTransports(java.util.Set<UserRecipient> userRecipients)


Copyright © 2012 Atlassian. All Rights Reserved.