public class MailThreadManagerImpl extends Object implements MailThreadManager
MailThreadManager.MailAction
ISSUE_COMMENTED_FROM_EMAIL, ISSUE_CREATED_FROM_EMAIL, NOTIFICATION_ISSUE_ASSIGNED, NOTIFICATION_ISSUE_CLOSED, NOTIFICATION_ISSUE_COMMENT_EDITED, NOTIFICATION_ISSUE_COMMENTED, NOTIFICATION_ISSUE_CREATED, NOTIFICATION_ISSUE_DELETED, NOTIFICATION_ISSUE_GENERICEVENT, NOTIFICATION_ISSUE_MOVED, NOTIFICATION_ISSUE_REOPENED, NOTIFICATION_ISSUE_RESOLVED, NOTIFICATION_ISSUE_UPDATED, NOTIFICATION_ISSUE_WORKLOG_DELETED, NOTIFICATION_ISSUE_WORKLOG_UPDATED, NOTIFICATION_ISSUE_WORKLOGGED, NOTIFICATION_ISSUE_WORKSTARTED, NOTIFICATION_ISSUE_WORKSTOPPED, NOTIFICATION_KEY
Constructor and Description |
---|
MailThreadManagerImpl(OfBizDelegator ofBizDelegator,
IssueManager issueManager,
EventTypeManager eventTypeManager) |
Modifier and Type | Method and Description |
---|---|
void |
createMailThread(String type,
Long source,
String emailAddress,
String messageId)
Remembers the given incoming MessageID.
|
Issue |
findIssueFromMessageId(String messageId)
Looks for an issue associated with the given message by inspecting the "Message-ID" header of the message.
|
org.ofbiz.core.entity.GenericValue |
getAssociatedIssue(javax.mail.Message message)
Looks for an issue associated with the given message.
|
Issue |
getAssociatedIssueObject(javax.mail.Message message)
Looks for an issue associated with the given message by inspecting the "In-Reply-To" header of the message.
|
String |
getThreadType(Long eventTypeId)
No longer used because we don't use store all outgoing notifications (see JRA-9979).
|
int |
removeAssociatedEntries(Long issueId)
Removes rows from NotificationInstance table associated with the given issue.
|
void |
storeIncomingMessageId(String messageId,
String senderAddress,
Issue issue,
MailThreadManager.MailAction action)
Remembers the given incoming MessageID.
|
void |
threadNotificationEmail(Email email,
Issue issue)
Thread the given email which is related to the given issue.
|
void |
threadNotificationEmail(Email email,
Long issueId)
Thread the given email which is related to the given issue.
|
public MailThreadManagerImpl(OfBizDelegator ofBizDelegator, IssueManager issueManager, EventTypeManager eventTypeManager)
public void storeIncomingMessageId(String messageId, String senderAddress, Issue issue, MailThreadManager.MailAction action)
MailThreadManager
This is used when someone emails JIRA and CCs some else, and that person in turn does a reply-all. Such an email will not have the Issue Key in the subject.
storeIncomingMessageId
in interface MailThreadManager
messageId
- The incoming Message-IDsenderAddress
- The senderissue
- the issue that was affected (created or commented)action
- Issue created or Issue commentedpublic void createMailThread(String type, Long source, String emailAddress, String messageId)
MailThreadManager
As of v5.2, this should only be used for incoming messages, outgoing "Notification" messages are ignored. Instead we craft a special Message-ID that we can parse the Issue ID out of if someone replies to the notification.
createMailThread
in interface MailThreadManager
public void threadNotificationEmail(Email email, Long issueId)
MailThreadManager
threadNotificationEmail
in interface MailThreadManager
email
- the email to be sentissueId
- the issue that the email is aboutpublic void threadNotificationEmail(Email email, Issue issue)
MailThreadManager
threadNotificationEmail
in interface MailThreadManager
email
- the email to be sentissue
- the issue that the email is aboutpublic String getThreadType(Long eventTypeId)
MailThreadManager
getThreadType
in interface MailThreadManager
eventTypeId
- eventTypeIdpublic org.ofbiz.core.entity.GenericValue getAssociatedIssue(javax.mail.Message message)
MailThreadManager
The "In-Reply-To" header of the message is parsed to see if it was sent by this JIRA server and if so we retrieve the Issue ID from it.
getAssociatedIssue
in interface MailThreadManager
message
- message to analyse@Nullable public Issue getAssociatedIssueObject(javax.mail.Message message)
MailThreadManager
Notifications sent from JIRA have a special form that allows us to parse out the Issue ID. We also remember the incoming Message-IDs so we can tell if another recipient replies to that message.
getAssociatedIssueObject
in interface MailThreadManager
message
- message to analysepublic Issue findIssueFromMessageId(String messageId)
MailThreadManager
findIssueFromMessageId
in interface MailThreadManager
messageId
- Message-ID to be checkedpublic int removeAssociatedEntries(Long issueId)
MailThreadManager
removeAssociatedEntries
in interface MailThreadManager
issueId
- the issueCopyright © 2002-2015 Atlassian. All Rights Reserved.