|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectAbstractMessageHandler
cern.jira.emailhandler.AdvancedCreateIssueHandler
public class AdvancedCreateIssueHandler
A message handler to create a new issue from an incoming message. Note: requires public noarg constructor as this class is instantiated by reflection.
Field Summary | |
---|---|
private static java.lang.String |
CC_ASSIGNEE
|
boolean |
ccAssignee
|
java.lang.String |
defaultIssueType
|
java.lang.String |
defaultProjectKey
|
private IssueDescriptor |
issueDescriptor
|
java.lang.String |
issueType
|
private static java.lang.String |
KEY_ISSUETYPE
|
private static java.lang.String |
KEY_PROJECT
|
private static Category |
log
|
private java.util.Collection |
priorities
|
java.lang.String |
projectKey
|
Constructor Summary | |
---|---|
AdvancedCreateIssueHandler()
|
Method Summary | |
---|---|
protected boolean |
attachHtmlParts(Part part)
Attaches HTML parts. |
protected boolean |
attachPlainTextParts(Part part)
Attaches plaintext parts. |
private java.lang.String |
getDefaultSystemPriority()
|
private java.lang.String |
getDescription(User reporter,
Message message)
Extracts the description of the issue from the message. |
static User |
getFirstValidAssignee(Address[] addresses,
GenericValue project)
Given an array of addresses, returns the first valid assignee for the appropriate project. |
private java.lang.String |
getPriority()
Get the issue's priority. |
protected GenericValue |
getProject()
|
protected ProjectManager |
getProjectManager()
|
static User |
getUserByName(java.lang.String userName)
Returns an User given its userName . |
boolean |
handleMessage(Message message)
|
protected boolean |
hasValidIssueType()
|
void |
init(java.util.Map params)
|
private boolean |
isEnterprise()
|
private static boolean |
isValidAssignee(GenericValue project,
User user)
Tells if user is a valid assignee for project . |
private java.lang.String |
recordFromAddressForAnon(User reporter,
Message message,
java.lang.String description)
Adds the senders' From: addresses to the end of the issue's details (if they could be extracted), if the e-mail has been received from an unknown e-mail address and the mapping to an "anonymous" user has been enabled. |
private void |
setDefaultSecurityLevel(MutableIssue issue)
|
(package private) void |
setIssueDescriptor(IssueDescriptor issueDescriptor)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Category log
private IssueDescriptor issueDescriptor
private java.util.Collection priorities
public java.lang.String projectKey
public java.lang.String issueType
public java.lang.String defaultProjectKey
public java.lang.String defaultIssueType
public boolean ccAssignee
private static final java.lang.String KEY_PROJECT
private static final java.lang.String KEY_ISSUETYPE
private static final java.lang.String CC_ASSIGNEE
Constructor Detail |
---|
public AdvancedCreateIssueHandler()
Method Detail |
---|
public void init(java.util.Map params)
public boolean handleMessage(Message message) throws MessagingException
MessagingException
protected GenericValue getProject()
protected boolean hasValidIssueType()
protected ProjectManager getProjectManager()
private java.lang.String getDescription(User reporter, Message message) throws MessagingException
reporter
- the established reporter of the issuemessage
- the message from which the issue is created
MessagingException
private java.lang.String recordFromAddressForAnon(User reporter, Message message, java.lang.String description) throws MessagingException
reporter
- the established reporter of the issue (after one has been established)message
- the message that is used to create issuedescription
- the issues extracted description
MessagingException
private java.lang.String getPriority()
private java.lang.String getDefaultSystemPriority()
public static User getFirstValidAssignee(Address[] addresses, GenericValue project)
addresses
- the addressesproject
- the project
project
private static boolean isValidAssignee(GenericValue project, User user)
user
is a valid assignee for project
.
project
- a projectuser
- an user
user
is a valid assignee for project
public static User getUserByName(java.lang.String userName)
User
given its userName
.
userName
- the name of the user
null
if there was no user with name userName
private void setDefaultSecurityLevel(MutableIssue issue) throws java.lang.Exception
java.lang.Exception
private boolean isEnterprise()
final void setIssueDescriptor(IssueDescriptor issueDescriptor)
protected boolean attachPlainTextParts(Part part) throws MessagingException, java.io.IOException
part
- the part which will have a content type of text/plain to be tested
MessagingException
java.io.IOException
protected boolean attachHtmlParts(Part part) throws MessagingException, java.io.IOException
part
- the part which will have a content type of text/html to be tested
MessagingException
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |