|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.jira.service.util.handler.AbstractMessageHandler
An AbstractMessageHandler that stores the parameter map.
Field Summary | |
String |
bulk
How to handle emails with header: "Precedence: bulk" |
String |
catchEmail
New issues without this receipient are ignored. |
protected static String |
CONTENT_TYPE_PKCS7
|
protected static String |
CONTENT_TYPE_TEXT
|
boolean |
createUsers
Whether to create users if they do not exist |
protected boolean |
deleteEmail
|
protected static String |
KEY_BULK
|
protected static String |
KEY_CATCHEMAIL
|
protected static String |
KEY_CREATEUSERS
|
protected static String |
KEY_NOTIFYUSERS
|
protected static String |
KEY_REPORTER
|
boolean |
notifyUsers
|
protected Map |
params
|
String |
reporteruserName
Username of default reporter, if sender not recognized. |
Constructor Summary | |
AbstractMessageHandler()
|
Method Summary | |
void |
addError(String error)
|
void |
addError(String error,
Exception e)
|
boolean |
addErrorAndReturnFalse(String error)
Deprecated. Please use addError(String) and return your own false :-) |
boolean |
addErrorAndReturnFalse(String error,
Exception e)
Deprecated. Please use addError(String) and return your own false :-) |
protected boolean |
canHandleMessage(javax.mail.Message message)
Validation call to be made at the start of handleMessage(). It sets a global boolean deleteEmail, whether the email should be deleted if it cannot be handled. |
protected Collection |
createAttachmentsForMessage(javax.mail.Message message,
org.ofbiz.core.entity.GenericValue issue)
Loops through all the Part s, and for each one of type Part.ATTACHMENT , call createAttachmentWithPart(BodyPart, Message, GenericValue) . |
protected ChangeItemBean |
createAttachmentWithPart(javax.mail.BodyPart part,
javax.mail.Message message,
org.ofbiz.core.entity.GenericValue issue)
Create an attachment for a particular mime-part. |
protected org.ofbiz.core.entity.GenericValue |
getAssociatedIssue(javax.mail.Message message)
|
protected MessageErrorHandler |
getErrorHandler()
|
protected File |
getFileFromPart(javax.mail.BodyPart part,
org.ofbiz.core.entity.GenericValue issue)
|
protected I18nBean |
getI18nBean()
|
protected String |
getPrecedenceHeader(javax.mail.Message message)
Extract the 'Precedence' header value from the message |
protected User |
getReporter(javax.mail.Message message)
Get the reporter from the email address who sent the message, or else create a new user if creating users is set to true, or use the default reporter if one is specified. |
abstract boolean |
handleMessage(javax.mail.Message message)
Perform the specific work of this handler for the given message. |
void |
init(Map params)
|
protected void |
recordMessageId(String type,
javax.mail.Message message,
Long issueId)
|
void |
setErrorHandler(MessageErrorHandler errorHandler)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static final String KEY_REPORTER
protected static final String KEY_CATCHEMAIL
protected static final String KEY_CREATEUSERS
protected static final String KEY_NOTIFYUSERS
protected static final String KEY_BULK
protected static final String CONTENT_TYPE_TEXT
protected static final String CONTENT_TYPE_PKCS7
protected boolean deleteEmail
protected Map params
public String reporteruserName
public String catchEmail
public String bulk
public boolean createUsers
public boolean notifyUsers
Constructor Detail |
public AbstractMessageHandler()
Method Detail |
public void init(Map params)
init
in interface MessageHandler
public abstract boolean handleMessage(javax.mail.Message message) throws javax.mail.MessagingException
handleMessage
in interface MessageHandler
javax.mail.MessagingException
- if anything went wrong.protected boolean canHandleMessage(javax.mail.Message message) throws javax.mail.MessagingException
message
-
javax.mail.MessagingException
protected Collection createAttachmentsForMessage(javax.mail.Message message, org.ofbiz.core.entity.GenericValue issue) throws IOException, javax.mail.MessagingException
Part
s, and for each one of type Part.ATTACHMENT
, call createAttachmentWithPart(BodyPart, Message, GenericValue)
.
message
- The multipart message to search for attachments inissue
- The issue to create attachments in
IOException
- If there is a problem creating the attachment
javax.mail.MessagingException
- If there is a problem reading the messageprotected ChangeItemBean createAttachmentWithPart(javax.mail.BodyPart part, javax.mail.Message message, org.ofbiz.core.entity.GenericValue issue) throws IOException
Part.ATTACHMENT
.
part
- The part of disposition Part.ATTACHMENT
to create the attachment fromissue
- The issue to create attachments in
ChangeItemBean
representing the added attachment, or null if no attachment was created
IOException
- If there is a problem creating the attachment in the filesystemprotected File getFileFromPart(javax.mail.BodyPart part, org.ofbiz.core.entity.GenericValue issue) throws IOException, javax.mail.MessagingException, org.ofbiz.core.entity.GenericEntityException
IOException
javax.mail.MessagingException
org.ofbiz.core.entity.GenericEntityException
protected User getReporter(javax.mail.Message message) throws javax.mail.MessagingException
message
- The email message to search through.
javax.mail.MessagingException
- If there is a problem getting the user who created the message.protected String getPrecedenceHeader(javax.mail.Message message) throws javax.mail.MessagingException
javax.mail.MessagingException
protected void recordMessageId(String type, javax.mail.Message message, Long issueId) throws javax.mail.MessagingException
javax.mail.MessagingException
protected org.ofbiz.core.entity.GenericValue getAssociatedIssue(javax.mail.Message message)
public void setErrorHandler(MessageErrorHandler errorHandler)
setErrorHandler
in interface MessageHandler
public void addError(String error)
public void addError(String error, Exception e)
public boolean addErrorAndReturnFalse(String error)
addError(String)
and return your own false :-)
public boolean addErrorAndReturnFalse(String error, Exception e)
addError(String)
and return your own false :-)
protected MessageErrorHandler getErrorHandler()
protected I18nBean getI18nBean()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |