com.atlassian.jira.plugins.mail.handlers
Class AbstractCommentHandler

java.lang.Object
  extended by com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler
      extended by com.atlassian.jira.plugins.mail.handlers.AbstractCommentHandler
All Implemented Interfaces:
MessageHandler
Direct Known Subclasses:
FullCommentHandler, NonQuotedCommentHandler, RegexCommentHandler

@ExperimentalApi
public abstract class AbstractCommentHandler
extends AbstractMessageHandler


Field Summary
 
Fields inherited from class com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler
applicationProperties, bulk, catchEmail, CONTENT_TYPE_TEXT, createUsers, deleteEmail, HEADER_IN_REPLY_TO, HEADER_MESSAGE_ID, KEY_BULK, KEY_CATCHEMAIL, KEY_CREATEUSERS, KEY_FINGER_PRINT, KEY_NOTIFYUSERS, KEY_REPORTER, log, messageUserProcessor, notifyUsers, params, reporteruserName, userManager, VALUE_BULK_DELETE, VALUE_BULK_FORWARD, VALUE_BULK_IGNORE, VALUE_FINGER_PRINT_ACCEPT, VALUE_FINGER_PRINT_FORWARD, VALUE_FINGER_PRINT_IGNORE
 
Constructor Summary
protected AbstractCommentHandler()
          Deprecated. Please use other constructor that explicitly sets dependencies
protected AbstractCommentHandler(PermissionManager permissionManager, IssueUpdater issueUpdater, ApplicationProperties applicationProperties, JiraApplicationContext jiraApplicationContext)
          Deprecated. Use AbstractCommentHandler(com.atlassian.jira.security.PermissionManager, com.atlassian.jira.issue.util.IssueUpdater, com.atlassian.jira.user.util.UserManager, com.atlassian.jira.config.properties.ApplicationProperties, com.atlassian.jira.JiraApplicationContext, com.atlassian.jira.mail.MailLoggingManager, com.atlassian.jira.service.util.handler.MessageUserProcessor) instead. Since v5.0.
protected AbstractCommentHandler(PermissionManager permissionManager, IssueUpdater issueUpdater, UserManager userManager, ApplicationProperties applicationProperties, JiraApplicationContext jiraApplicationContext, MailLoggingManager mailLoggingManager, MessageUserProcessor messageUserProcessor)
           
 
Method Summary
protected abstract  String getEmailBody(javax.mail.Message message)
           
static Long getEventTypeId(Collection attachmentsChangeItems)
          If there are attachments added dispatch EventType.ISSUE_UPDATED_ID, otherwise dispatch EventType.ISSUE_COMMENTED_ID.
 boolean handleMessage(javax.mail.Message message, MessageHandlerContext context)
          Perform the specific work of this handler for the given message.
 
Methods inherited from class com.atlassian.jira.plugins.mail.handlers.AbstractMessageHandler
attachAttachmentsParts, attachHtmlParts, attachInlineParts, attachMessagePart, attachPlainTextParts, attachRelatedPart, canHandleMessage, createAttachmentsForMessage, createAttachmentWithPart, createUserForReporter, getAssociatedIssue, getFileFromPart, getFilenameForAttachment, getI18nBean, getMessageUserProcessor, getPrecedenceHeader, getReporter, init, isAutoSubmitted, isDeliveryStatus, recordMessageId, renameFileIfInvalid, shouldAttach
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCommentHandler

protected AbstractCommentHandler()
Deprecated. Please use other constructor that explicitly sets dependencies


AbstractCommentHandler

protected AbstractCommentHandler(PermissionManager permissionManager,
                                 IssueUpdater issueUpdater,
                                 ApplicationProperties applicationProperties,
                                 JiraApplicationContext jiraApplicationContext)
Deprecated. Use AbstractCommentHandler(com.atlassian.jira.security.PermissionManager, com.atlassian.jira.issue.util.IssueUpdater, com.atlassian.jira.user.util.UserManager, com.atlassian.jira.config.properties.ApplicationProperties, com.atlassian.jira.JiraApplicationContext, com.atlassian.jira.mail.MailLoggingManager, com.atlassian.jira.service.util.handler.MessageUserProcessor) instead. Since v5.0.

Deprecated Constructor.


AbstractCommentHandler

protected AbstractCommentHandler(PermissionManager permissionManager,
                                 IssueUpdater issueUpdater,
                                 UserManager userManager,
                                 ApplicationProperties applicationProperties,
                                 JiraApplicationContext jiraApplicationContext,
                                 MailLoggingManager mailLoggingManager,
                                 MessageUserProcessor messageUserProcessor)
Method Detail

handleMessage

public boolean handleMessage(javax.mail.Message message,
                             MessageHandlerContext context)
                      throws javax.mail.MessagingException
Description copied from class: AbstractMessageHandler
Perform the specific work of this handler for the given message.

Specified by:
handleMessage in interface MessageHandler
Specified by:
handleMessage in class AbstractMessageHandler
Parameters:
message - the message to check for handling.
context - user-friendly message handler should utilize this interface to create issue, comments, users and provide feedback information about messages being processed and problems being encountered. While MessageHandler-s are run from UI (in TEST / dry-run mode) such invocations are not mutative (they do not create any JIRA entities) and information provided by the handler is displayed back to the user as a summary of the dry-run.
Returns:
true if the message is to be deleted from the source.
Throws:
javax.mail.MessagingException - if anything went wrong.

getEventTypeId

public static Long getEventTypeId(Collection attachmentsChangeItems)
If there are attachments added dispatch EventType.ISSUE_UPDATED_ID, otherwise dispatch EventType.ISSUE_COMMENTED_ID.


getEmailBody

protected abstract String getEmailBody(javax.mail.Message message)
                                throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException


Copyright © 2002-2012 Atlassian. All Rights Reserved.