com.atlassian.jira.notification.type
Class SingleUser

java.lang.Object
  extended by com.atlassian.jira.notification.type.AbstractNotificationType
      extended by com.atlassian.jira.notification.type.SingleUser
All Implemented Interfaces:
NotificationType

public class SingleUser
extends AbstractNotificationType


Field Summary
static String DESC
           
 
Constructor Summary
SingleUser(JiraAuthenticationContext jiraAuthenticationContext)
           
 
Method Summary
 boolean doValidation(String key, Map parameters)
          Validate the configuration (the argument in NotificationType.getRecipients(com.atlassian.jira.event.issue.IssueEvent, String)) when it is entered in the "Add Notification" page.
 String getArgumentDisplay(String argument)
          Obtains the user-friendly display for the argument.
 String getArgumentValue(String displayValue)
          Obtains the raw parameter value to save for the given user entry user-friendly display value.
 String getDisplayName()
          Text to display for this type, on the "Add Notification" page.
 List<NotificationRecipient> getRecipients(IssueEvent event, String userKey)
          Who is to be notified of an event.
 String getType()
          Type identifier (currently unused).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DESC

public static final String DESC
See Also:
Constant Field Values
Constructor Detail

SingleUser

public SingleUser(JiraAuthenticationContext jiraAuthenticationContext)
Method Detail

getRecipients

public List<NotificationRecipient> getRecipients(IssueEvent event,
                                                 String userKey)
Description copied from interface: NotificationType
Who is to be notified of an event.

Parameters:
event - The event, eg. issue created
userKey - Configuration from notification scheme, eg. group name, custom field id.
Returns:
A list of NotificationRecipients.

getDisplayName

public String getDisplayName()
Description copied from interface: NotificationType
Text to display for this type, on the "Add Notification" page.

Returns:
(Internationalized) text to display, eg. "Group".

getType

public String getType()
Description copied from interface: NotificationType
Type identifier (currently unused).

Specified by:
getType in interface NotificationType
Overrides:
getType in class AbstractNotificationType
Returns:
Eg. "group"

doValidation

public boolean doValidation(String key,
                            Map parameters)
Description copied from interface: NotificationType
Validate the configuration (the argument in NotificationType.getRecipients(com.atlassian.jira.event.issue.IssueEvent, String)) when it is entered in the "Add Notification" page. For instance, a group notification type might check if the entered group exists.

Specified by:
doValidation in interface NotificationType
Overrides:
doValidation in class AbstractNotificationType
Parameters:
key - Key of relevant value in parameters
parameters - HTML form parameters (only the keyed entry is relevant).
Returns:
Whether the entered value is valid for this type.

getArgumentDisplay

public String getArgumentDisplay(String argument)
Description copied from interface: NotificationType
Obtains the user-friendly display for the argument. For example, returns a username for a key.

Specified by:
getArgumentDisplay in interface NotificationType
Overrides:
getArgumentDisplay in class AbstractNotificationType
Parameters:
argument - Raw configuration value
Returns:
Formatted configuration value.

getArgumentValue

public String getArgumentValue(String displayValue)
Description copied from interface: NotificationType
Obtains the raw parameter value to save for the given user entry user-friendly display value. For example, the user picker displays a username, but this needs to be stored in the configuration parameter as the user's key, instead.

Specified by:
getArgumentValue in interface NotificationType
Overrides:
getArgumentValue in class AbstractNotificationType
Parameters:
displayValue - Value entered into the form (username, for example)
Returns:
raw configuration value.


Copyright © 2002-2013 Atlassian. All Rights Reserved.