|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.cert.cc.jira.email.handler.JIRAMediatorImpl
public class JIRAMediatorImpl
JIRAMediatorImpl is the go between for most JIRA operations.
© 2009 Carnegie Mellon University
Field Summary | |
---|---|
protected static String |
PARAMETER_ADD_CC_WATCHERS
add CC users configuration key |
protected static String |
PARAMETER_DEFAULT_ASSIGNEE
default assignee key |
protected static String |
PARAMETER_DEFAULT_PRIORITY
priority configuration key |
protected static String |
PARAMETER_ISSUE_TYPE
issue type configuration key |
protected static String |
PARAMETER_PROJECT
project configuration key |
protected static String |
PARAMETER_REPORTER_IS_ASSIGNEE
reporter always as assignee configuration key |
protected static String |
PARAMETER_REPORTER_OVERRIDE
reporter override |
protected static String |
PARAMETER_REPORTER_USER
report user key |
protected static String |
PARAMETER_SCAN_RECIPIENTS_FOR_ASSIGNEE
scan recipinet list for assigniee configuration key |
protected static String |
PARAMETER_SUPPRESS_CREATED
suppress the created by configuration key |
Constructor Summary | |
---|---|
JIRAMediatorImpl(Map<String,String> parameters)
Constructs a new JIRAMediatorImpl |
Method Summary | |
---|---|
IssueType |
calculateIssueType(Message message)
Calculates and returns the JIRA IssueType |
Priority |
calculatePriority(Message message)
Calculates and returns the JIRA issue Priority |
User |
determineAssignee(Message message,
Project project,
User reporter)
Calculates and returns the issue assignee. |
Priority |
getDefaultSystemPriority()
Returns the default system Priority |
String |
getDescription(Message message)
Returns the description |
IssueType |
getIssueType(String issueTypeId)
Returns the IssueType based on its ID |
String |
getParameterValue(Message message,
String key,
String xHeaderName)
Returns a parameter value or an X-Header value. |
String |
getParameterValue(String key)
Returns a parameter value based on the key |
List<Priority> |
getPossiblePriorties()
Returns all of the possible Priority values |
Priority |
getPriority(int id)
Returns the Priority based on its id value |
Comparator<Priority> |
getPriorityComparator()
Returns a Comparator for Priority s |
Project |
getProject(String projectKey)
Returns the Project based on the key. |
GenericValue |
getProjectByName(String projectName)
Returns the Project based on the key. |
User |
getUser(String identifier)
Returns the JIRA User based on:
If the identifier has an @, check to see the email address corresponds to a user.
If the identifier does not have a @, check for username only. |
User |
getUserByEmail(String address)
Returns the JIRA User based on their email address |
User |
getUserByUsername(String username)
Returns the JIRA User based on their username |
boolean |
isValidUser(String emailAddress)
Returns if the emailAddress is a valid JIRA user |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String PARAMETER_PROJECT
protected static final String PARAMETER_DEFAULT_PRIORITY
protected static final String PARAMETER_ADD_CC_WATCHERS
protected static final String PARAMETER_ISSUE_TYPE
protected static final String PARAMETER_REPORTER_OVERRIDE
protected static final String PARAMETER_REPORTER_IS_ASSIGNEE
protected static final String PARAMETER_DEFAULT_ASSIGNEE
protected static final String PARAMETER_REPORTER_USER
protected static final String PARAMETER_SCAN_RECIPIENTS_FOR_ASSIGNEE
protected static final String PARAMETER_SUPPRESS_CREATED
Constructor Detail |
---|
public JIRAMediatorImpl(Map<String,String> parameters)
parameters
- Handler parametersMethod Detail |
---|
public final User determineAssignee(Message message, Project project, User reporter) throws MessagingException
determineAssignee
in interface JIRAMediator
message
- Email Message
project
- JIRA Project
reporter
- Who is reporting this issue
MessagingException
- If unable to interrogate the Message
public final IssueType calculateIssueType(Message message) throws MessagingException
IssueType
calculateIssueType
in interface JIRAMediator
message
- Email Message
IssueType
MessagingException
- If unable to interrogate the Message
public final Priority calculatePriority(Message message) throws MessagingException
Priority
calculatePriority
in interface JIRAMediator
message
- Email Message
Priority
MessagingException
- If unable to interrogate the Message
public Priority getPriority(int id)
Priority
based on its id value
getPriority
in interface JIRAMediator
id
- Integer value for the Priority
Priority
public IssueType getIssueType(String issueTypeId)
IssueType
based on its ID
getIssueType
in interface JIRAMediator
issueTypeId
- IssueType
ID
IssueType
public List<Priority> getPossiblePriorties()
Priority
values
getPossiblePriorties
in interface JIRAMediator
public Project getProject(String projectKey)
Project
based on the key. If no Project
is found, null
will be returned.
getProject
in interface JIRAMediator
projectKey
- Project
key
Project
public GenericValue getProjectByName(String projectName) throws DataAccessException
getProjectByName
in interface JIRAMediator
projectName
- Project name
DataAccessException
- If unable to find the projectpublic Priority getDefaultSystemPriority()
Priority
getDefaultSystemPriority
in interface JIRAMediator
public final User getUser(String identifier) throws EntityNotFoundException
User
based on:
identifier
has an @, check to see the email address corresponds to a user.identifier
does not have a @, check for username only. identifier
has an @ and the email address is invalid, check the username part only of the email address.
getUser
in interface JIRAMediator
identifier
- Identifier (username or email address)
User
EntityNotFoundException
- If no matching User
is foundpublic User getUserByEmail(String address) throws EntityNotFoundException
User
based on their email address
getUserByEmail
in interface JIRAMediator
address
- Email address
User
EntityNotFoundException
- If no User
matches the email addresspublic User getUserByUsername(String username) throws EntityNotFoundException
User
based on their username
getUserByUsername
in interface JIRAMediator
username
- JIRA username
User
EntityNotFoundException
- If no User
matches the usernamepublic boolean isValidUser(String emailAddress)
emailAddress
is a valid JIRA user
isValidUser
in interface JIRAMediator
emailAddress
- Email address
emailAddress
is a valid JIRA userpublic String getDescription(Message message) throws MessagingException
getDescription
in interface JIRAMediator
message
- Email Message
MessagingException
- If unable to interrogate the Message
public final String getParameterValue(String key)
key
getParameterValue
in interface JIRAMediator
public final String getParameterValue(Message message, String key, String xHeaderName) throws MessagingException
getParameterValue
in interface JIRAMediator
message
- Email Message
key
- Parameter keyxHeaderName
- X-Header name
MessagingException
- If unable to interrogate the Message
public Comparator<Priority> getPriorityComparator()
Comparator
for Priority
s
getPriorityComparator
in interface JIRAMediator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |