public class MailThreadManagerImpl extends Object implements MailThreadManager
MailThreadManager.MailAction
Constructor and Description |
---|
MailThreadManagerImpl(OfBizDelegator ofBizDelegator,
IssueManager issueManager) |
Modifier and Type | Method and Description |
---|---|
Issue |
findIssueFromMessageId(String messageId)
Looks for an issue associated with the given message by inspecting the "Message-ID" header of the message.
|
List<Issue> |
findIssuesFromMessageId(String messageId)
Looks for issues associated with the given message by inspecting the "Message-ID" header of the 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.
|
List<Issue> |
getAssociatedIssueObjects(javax.mail.Message message)
Looks for issues associated with the given message by inspecting the "In-Reply-To" header of the message.
|
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 that given messageId has been used to either create or comment on an Issue.
|
void |
threadNotificationEmail(Email email,
Issue issue)
Thread the given email which is related to the given issue.
|
public MailThreadManagerImpl(OfBizDelegator ofBizDelegator, IssueManager issueManager)
public void storeIncomingMessageId(String messageId, String senderAddress, Issue issue, MailThreadManager.MailAction action)
MailThreadManager
This creates an entry in "NotificationInstance" table that will only be removed in two cases
MailThreadManager.removeAssociatedEntries(Long)
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 threadNotificationEmail(Email email, Issue issue)
MailThreadManager
threadNotificationEmail
in interface MailThreadManager
email
- the email to be sentissue
- the issue that the email is about@Nonnull public List<Issue> getAssociatedIssueObjects(javax.mail.Message message)
MailThreadManager
Notifications sent from JIRA have a special form that allows us to parse out the Issue ID, there should only be a single associated message in this case. We also remember the incoming Message-IDs so we can tell if another recipient replies to that message.
getAssociatedIssueObjects
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, but we assume only one issue can be associated with an incoming message ID.
getAssociatedIssueObject
in interface MailThreadManager
message
- message to analysepublic Issue findIssueFromMessageId(String messageId)
MailThreadManager
findIssueFromMessageId
in interface MailThreadManager
messageId
- Message-ID to be checked@Nonnull public List<Issue> findIssuesFromMessageId(String messageId)
MailThreadManager
findIssuesFromMessageId
in interface MailThreadManager
messageId
- Message-ID to be checkedpublic int removeAssociatedEntries(Long issueId)
MailThreadManager
removeAssociatedEntries
in interface MailThreadManager
issueId
- the issueCopyright © 2002-2022 Atlassian. All Rights Reserved.