@PublicApi public interface

MailThreadManager

com.atlassian.jira.mail.MailThreadManager
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Summary

Nested Classes
enum MailThreadManager.MailAction Indicates an action in response to an incoming email. 
Constants
String ISSUE_COMMENTED_FROM_EMAIL This constant is deprecated. Use ISSUE_COMMENTED_FROM_EMAIL instead. Since v5.2.
String ISSUE_CREATED_FROM_EMAIL This constant is deprecated. Use ISSUE_CREATED_FROM_EMAIL instead. Since v5.2.
String NOTIFICATION_KEY This constant is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
Fields
public static final String NOTIFICATION_ISSUE_ASSIGNED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_CLOSED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_COMMENTED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_COMMENT_EDITED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_CREATED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_DELETED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_GENERICEVENT This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_MOVED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_REOPENED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_RESOLVED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_UPDATED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_WORKLOGGED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_WORKLOG_DELETED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_WORKLOG_UPDATED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_WORKSTARTED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
public static final String NOTIFICATION_ISSUE_WORKSTOPPED This field is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
Public Methods
void createMailThread(String type, Long source, String emailAddress, String messageId)
@Deprecated GenericValue getAssociatedIssue(Message message)
This method is deprecated. use instead getAssociatedIssueObject(Message) method. Since 26/11/2011
@Nullable Issue getAssociatedIssueObject(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)
This method is deprecated. No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.
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, Long issueId)
This method is deprecated. Use threadNotificationEmail(Email, com.atlassian.jira.issue.Issue) instead. Since v5.2.
void threadNotificationEmail(Email email, Issue issue)
Thread the given email which is related to the given issue.

Constants

public static final String ISSUE_COMMENTED_FROM_EMAIL

This constant is deprecated.
Use ISSUE_COMMENTED_FROM_EMAIL instead. Since v5.2.

Constant Value: "ISSUE_COMMENTED_FROM_EMAIL"

public static final String ISSUE_CREATED_FROM_EMAIL

This constant is deprecated.
Use ISSUE_CREATED_FROM_EMAIL instead. Since v5.2.

Constant Value: "ISSUE_CREATED_FROM_EMAIL"

public static final String NOTIFICATION_KEY

This constant is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

Constant Value: "NOTIFICATION_"

Fields

public static final String NOTIFICATION_ISSUE_ASSIGNED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_CLOSED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_COMMENTED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_COMMENT_EDITED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_CREATED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_DELETED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_GENERICEVENT

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_MOVED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_REOPENED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_RESOLVED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_UPDATED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_WORKLOGGED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_WORKLOG_DELETED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_WORKLOG_UPDATED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_WORKSTARTED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

public static final String NOTIFICATION_ISSUE_WORKSTOPPED

This field is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

Public Methods

public void createMailThread (String type, Long source, String emailAddress, String messageId)

This method is deprecated.
Use storeIncomingMessageId(String, String, com.atlassian.jira.issue.Issue, com.atlassian.jira.mail.MailThreadManager.MailAction) instead. Since v5.2.3.

Remembers the given incoming MessageID.

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.

@Deprecated public GenericValue getAssociatedIssue (Message message)

This method is deprecated.
use instead getAssociatedIssueObject(Message) method. Since 26/11/2011

Looks for an issue associated with the given message.

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.

Parameters
message message to analyse
Returns
  • associated issue or null if no issue is associated with this message.

@Nullable public Issue getAssociatedIssueObject (Message message)

Looks for an issue associated with the given message by inspecting the "In-Reply-To" header of the message.

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.

Parameters
message message to analyse
Returns
  • associated issue or null if no issue is associated with this message.

public String getThreadType (Long eventTypeId)

This method is deprecated.
No longer used because we don't use store all outgoing notifications (see JRA-9979). Since v5.2.

No longer used because we don't use store all outgoing notifications (see JRA-9979).

Parameters
eventTypeId eventTypeId

public int removeAssociatedEntries (Long issueId)

Removes rows from NotificationInstance table associated with the given issue. Used when we delete an issue.

Parameters
issueId the issue
Returns
  • row count

public void storeIncomingMessageId (String messageId, String senderAddress, Issue issue, MailThreadManager.MailAction action)

Remembers the given incoming MessageID.

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.

Parameters
messageId The incoming Message-ID
senderAddress The sender
issue the issue that was affected (created or commented)
action Issue created or Issue commented

public void threadNotificationEmail (Email email, Long issueId)

This method is deprecated.
Use threadNotificationEmail(Email, com.atlassian.jira.issue.Issue) instead. Since v5.2.

Thread the given email which is related to the given issue.

Parameters
email the email to be sent
issueId the issue that the email is about

public void threadNotificationEmail (Email email, Issue issue)

Thread the given email which is related to the given issue.

Parameters
email the email to be sent
issue the issue that the email is about