com.atlassian.jira.service.util.handler
Class CVSLogHandler

java.lang.Object
  extended by com.atlassian.jira.service.util.handler.AbstractMessageHandler
      extended by com.atlassian.jira.service.util.handler.CVSLogHandler
All Implemented Interfaces:
MessageHandler

public class CVSLogHandler
extends AbstractMessageHandler


Field Summary
 
Fields inherited from class com.atlassian.jira.service.util.handler.AbstractMessageHandler
applicationProperties, bulk, catchEmail, commentManager, CONTENT_TYPE_TEXT, createUsers, deleteEmail, HEADER_IN_REPLY_TO, HEADER_MESSAGE_ID, issueFactory, KEY_BULK, KEY_CATCHEMAIL, KEY_CREATEUSERS, KEY_FINGER_PRINT, KEY_NOTIFYUSERS, KEY_REPORTER, notifyUsers, params, reporteruserName
 
Constructor Summary
CVSLogHandler()
           
 
Method Summary
protected  boolean attachHtmlParts(javax.mail.Part part)
          Html parts are currently not attached, and simply ignored and lost.
protected  boolean attachPlainTextParts(javax.mail.Part part)
          Plain text parts are currently not attached, and simply ignored and lost.
 String getCommentArea(String messageBody)
          Get the actual comment text from a CVS log email.
protected  CommentManager getCommentManager()
          This method was extracted and made protected to allow unit test mocking
 boolean handleMessage(javax.mail.Message message)
          Perform the specific work of this handler for the given message.
protected  boolean hasUserPermissionToComment(org.ofbiz.core.entity.GenericValue issue, User reporter)
          Returns true if the specified user has permission to comment on given issue.
 
Methods inherited from class com.atlassian.jira.service.util.handler.AbstractMessageHandler
addError, addError, addErrorAndReturnFalse, addErrorAndReturnFalse, attachAttachmentsParts, attachInlineParts, attachMessagePart, attachRelatedPart, canHandleMessage, createAttachmentsForMessage, createAttachmentWithPart, createUserForReporter, findUserByEmail, findUserByUsername, getAssociatedIssue, getErrorHandler, getFileFromPart, getFilenameForAttachment, getI18nBean, getPrecedenceHeader, getReporter, init, recordMessageId, renameFileIfInvalid, setErrorHandler, shouldAttach
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CVSLogHandler

public CVSLogHandler()
Method Detail

handleMessage

public boolean handleMessage(javax.mail.Message message)
                      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.
Returns:
true if the message is to be deleted from the source.
Throws:
javax.mail.MessagingException - if anything went wrong.

getCommentManager

protected CommentManager getCommentManager()
This method was extracted and made protected to allow unit test mocking

Returns:
comment manager

hasUserPermissionToComment

protected boolean hasUserPermissionToComment(org.ofbiz.core.entity.GenericValue issue,
                                             User reporter)
Returns true if the specified user has permission to comment on given issue.

Parameters:
issue - issue to comment on
reporter - commenting user
Returns:
true if permission granted, false otherwise

getCommentArea

public String getCommentArea(String messageBody)
Get the actual comment text from a CVS log email. This is done by reading through line by line, and parsing the comment body.

Parameters:
messageBody - message body
Returns:
comment from CVS log email

attachPlainTextParts

protected boolean attachPlainTextParts(javax.mail.Part part)
                                throws javax.mail.MessagingException,
                                       IOException
Plain text parts are currently not attached, and simply ignored and lost. This method always returns false.

Specified by:
attachPlainTextParts in class AbstractMessageHandler
Parameters:
part -
Returns:
Throws:
javax.mail.MessagingException - if javamail complains
IOException - if javamail complains

attachHtmlParts

protected boolean attachHtmlParts(javax.mail.Part part)
                           throws javax.mail.MessagingException,
                                  IOException
Html parts are currently not attached, and simply ignored and lost. This method always returns false.

Specified by:
attachHtmlParts in class AbstractMessageHandler
Parameters:
part -
Returns:
Throws:
javax.mail.MessagingException
IOException


Copyright © 2002-2008 Atlassian. All Rights Reserved.