com.atlassian.bamboo.notification.recipients
Class UserRecipient

java.lang.Object
  extended by com.atlassian.bamboo.notification.recipients.AbstractNotificationRecipient
      extended by com.atlassian.bamboo.notification.recipients.UserRecipient
All Implemented Interfaces:
NotificationRecipient, java.lang.Comparable

public class UserRecipient
extends AbstractNotificationRecipient

Represents a user notification recipient. Knows how to obtain user notification preferences and generate NotificationTransports accordingly.


Field Summary
static java.lang.String USER_FIELD
           
 
Fields inherited from class com.atlassian.bamboo.notification.recipients.AbstractNotificationRecipient
notificationRecipientModuleDescriptor
 
Constructor Summary
UserRecipient()
           
 
Method Summary
 java.lang.String getEditHtml()
          Returns the html to be displayed on the edit screen (to input data into notification type)
 java.lang.String getRecipientConfig()
          Retrieve string representation of data - if none exists retrun empty string
 java.util.List<NotificationTransport> getTransports()
          Evaluates the appropriate mediums for sending notificaions for this recipient, returning a list of appropriate transports.
 java.lang.String getUsername()
           
 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 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
 void setBambooUserManager(BambooUserManager bambooUserManager)
           
 void setNotificationFactory(NotificationFactory notificationFactory)
           
 void setTemplateRenderer(TemplateRenderer templateRenderer)
           
 void setUsername(java.lang.String username)
           
 ErrorCollection validate(java.util.Map<java.lang.String,java.lang.String[]> params)
          validate the user inputed data
 
Methods inherited from class com.atlassian.bamboo.notification.recipients.AbstractNotificationRecipient
compareTo, getDescription, getKey, getModuleDescriptor, getParam, init
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

USER_FIELD

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

UserRecipient

public UserRecipient()
Method Detail

getTransports

@NotNull
public java.util.List<NotificationTransport> getTransports()
Description copied from interface: NotificationRecipient
Evaluates the appropriate mediums for sending notificaions for this recipient, returning a list of appropriate transports.

Returns:

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
Overrides:
init in class AbstractNotificationRecipient

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
Overrides:
getRecipientConfig in class AbstractNotificationRecipient
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
Overrides:
populate in class AbstractNotificationRecipient
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
Overrides:
validate in class AbstractNotificationRecipient
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
Overrides:
getEditHtml in class AbstractNotificationRecipient
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
Overrides:
getViewHtml in class AbstractNotificationRecipient
Returns:
HTML of data for view configuration. If this returns null the description will be used.

setUsername

public void setUsername(java.lang.String username)

getUsername

public java.lang.String getUsername()

setBambooUserManager

public void setBambooUserManager(BambooUserManager bambooUserManager)

setNotificationFactory

public void setNotificationFactory(NotificationFactory notificationFactory)

setTemplateRenderer

public void setTemplateRenderer(TemplateRenderer templateRenderer)


Copyright © 2010 Atlassian. All Rights Reserved.