|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.jira.service.util.handler.AbstractMessageHandler
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 org.apache.log4j.Category |
log
|
private java.util.Collection |
priorities
|
java.lang.String |
projectKey
|
Fields inherited from class com.atlassian.jira.service.util.handler.AbstractMessageHandler |
---|
applicationProperties, bulk, catchEmail, commentManager, CONTENT_TYPE_PKCS7, CONTENT_TYPE_TEXT, createUsers, deleteEmail, issueFactory, KEY_BULK, KEY_CATCHEMAIL, KEY_CREATEUSERS, KEY_NOTIFYUSERS, KEY_REPORTER, notifyUsers, params, reporteruserName |
Constructor Summary | |
---|---|
AdvancedCreateIssueHandler()
|
Method Summary | |
---|---|
private java.lang.String |
getDefaultSystemPriority()
|
private java.lang.String |
getDescription(com.opensymphony.user.User reporter,
javax.mail.Message message)
Extracts the description of the issue from the message. |
static com.opensymphony.user.User |
getFirstValidAssignee(javax.mail.Address[] addresses,
org.ofbiz.core.entity.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 org.ofbiz.core.entity.GenericValue |
getProject()
|
protected com.atlassian.jira.project.ProjectManager |
getProjectManager()
|
static com.opensymphony.user.User |
getUserByName(java.lang.String userName)
Returns an User given its userName . |
boolean |
handleMessage(javax.mail.Message message)
|
protected boolean |
hasValidIssueType()
|
void |
init(java.util.Map params)
|
private boolean |
isEnterprise()
|
private static boolean |
isValidAssignee(org.ofbiz.core.entity.GenericValue project,
com.opensymphony.user.User user)
Tells if user is a valid assignee for project . |
private java.lang.String |
recordFromAddressForAnon(com.opensymphony.user.User reporter,
javax.mail.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(com.atlassian.jira.issue.MutableIssue issue)
|
(package private) void |
setIssueDescriptor(IssueDescriptor issueDescriptor)
|
Methods inherited from class com.atlassian.jira.service.util.handler.AbstractMessageHandler |
---|
addError, addError, addErrorAndReturnFalse, addErrorAndReturnFalse, canHandleMessage, createAttachmentsForMessage, createAttachmentWithPart, createUserForReporter, getAssociatedIssue, getErrorHandler, getFileFromPart, getI18nBean, getPrecedenceHeader, getReporter, recordMessageId, setErrorHandler |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.log4j.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)
init
in interface com.atlassian.jira.service.util.handler.MessageHandler
init
in class com.atlassian.jira.service.util.handler.AbstractMessageHandler
public boolean handleMessage(javax.mail.Message message) throws javax.mail.MessagingException
handleMessage
in interface com.atlassian.jira.service.util.handler.MessageHandler
handleMessage
in class com.atlassian.jira.service.util.handler.AbstractMessageHandler
javax.mail.MessagingException
protected org.ofbiz.core.entity.GenericValue getProject()
protected boolean hasValidIssueType()
protected com.atlassian.jira.project.ProjectManager getProjectManager()
private java.lang.String getDescription(com.opensymphony.user.User reporter, javax.mail.Message message) throws javax.mail.MessagingException
reporter
- the established reporter of the issuemessage
- the message from which the issue is created
javax.mail.MessagingException
private java.lang.String recordFromAddressForAnon(com.opensymphony.user.User reporter, javax.mail.Message message, java.lang.String description) throws javax.mail.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
javax.mail.MessagingException
private java.lang.String getPriority()
private java.lang.String getDefaultSystemPriority()
public static com.opensymphony.user.User getFirstValidAssignee(javax.mail.Address[] addresses, org.ofbiz.core.entity.GenericValue project)
addresses
- the addressesproject
- the project
project
private static boolean isValidAssignee(org.ofbiz.core.entity.GenericValue project, com.opensymphony.user.User user)
user
is a valid assignee for project
.
project
- a projectuser
- an user
user
is a valid assignee for project
public static com.opensymphony.user.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(com.atlassian.jira.issue.MutableIssue issue) throws java.lang.Exception
java.lang.Exception
private boolean isEnterprise()
final void setIssueDescriptor(IssueDescriptor issueDescriptor)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |