com.atlassian.jira.plugins.mail
Class DryRunMessageHandlerExecutionMonitor

java.lang.Object
  extended by com.atlassian.jira.plugins.mail.DryRunMessageHandlerExecutionMonitor
All Implemented Interfaces:
MessageHandlerErrorCollector, MessageHandlerExecutionMonitor

public class DryRunMessageHandlerExecutionMonitor
extends Object
implements MessageHandlerExecutionMonitor

MessageHandlerExecutionMonitor used in test run.


Constructor Summary
DryRunMessageHandlerExecutionMonitor()
           
 
Method Summary
 void error(String error)
          Report an error.
 void error(String error, Throwable e)
          Report an error.
 List<String> getAllMessages()
           
 Iterable<String> getErrorMessages()
           
 int getNumMessages()
           
 int getNumMessagesRejected()
           
 boolean hasErrors()
           
 void info(String info)
          Report valuable information for JIRA admin
 void info(String info, Throwable e)
          Report valuable information for JIRA admin
 void messageRejected(javax.mail.Message message, String reason)
          Reports the rejection of the message
 void nextMessage(javax.mail.Message message)
          Reports that given message is about to be dispatched to the message handler.
 void setNumMessages(int count)
          Report the number of messages ready for processing by the handler in the current run
 void warning(String warning)
          Report a warning
 void warning(String warning, Throwable e)
          Report a warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DryRunMessageHandlerExecutionMonitor

public DryRunMessageHandlerExecutionMonitor()
Method Detail

error

public void error(String error,
                  @Nullable
                  Throwable e)
Description copied from interface: MessageHandlerErrorCollector
Report an error.

Specified by:
error in interface MessageHandlerErrorCollector
Parameters:
error - a serious problem which usually makes further hanling of given message pointless
e - associated throwable or null

error

public void error(String error)
Description copied from interface: MessageHandlerErrorCollector
Report an error.

Specified by:
error in interface MessageHandlerErrorCollector
Parameters:
error - a serious problem which usually makes further hanling of given message pointless

info

public void info(String info)
Description copied from interface: MessageHandlerErrorCollector
Report valuable information for JIRA admin

Specified by:
info in interface MessageHandlerErrorCollector
Parameters:
info - information message (something expected, OK, normal)

info

public void info(String info,
                 @Nullable
                 Throwable e)
Description copied from interface: MessageHandlerErrorCollector
Report valuable information for JIRA admin

Specified by:
info in interface MessageHandlerErrorCollector
Parameters:
info - information message (something expected, OK, normal)
e - associated throwable or null

warning

public void warning(String warning)
Description copied from interface: MessageHandlerErrorCollector
Report a warning

Specified by:
warning in interface MessageHandlerErrorCollector
Parameters:
warning - a warning, but nothing critical for the handler

warning

public void warning(String warning,
                    @Nullable
                    Throwable e)
Description copied from interface: MessageHandlerErrorCollector
Report a warning

Specified by:
warning in interface MessageHandlerErrorCollector
Parameters:
warning - a warning, but nothing critical for the handler
e - associated throwable or null

hasErrors

public boolean hasErrors()

messageRejected

public void messageRejected(javax.mail.Message message,
                            String reason)
Description copied from interface: MessageHandlerExecutionMonitor
Reports the rejection of the message

Specified by:
messageRejected in interface MessageHandlerExecutionMonitor
Parameters:
message - the message which has been rejected (should be the one reported before with nextMessage() method.
reason - the reason of the rejection (may be displayed in the web UI, so translated messages are desirable here)

nextMessage

public void nextMessage(javax.mail.Message message)
Description copied from interface: MessageHandlerExecutionMonitor
Reports that given message is about to be dispatched to the message handler.

Specified by:
nextMessage in interface MessageHandlerExecutionMonitor
Parameters:
message - the message which is about to be dispatched to the handler.

getAllMessages

public List<String> getAllMessages()

setNumMessages

public void setNumMessages(int count)
Description copied from interface: MessageHandlerExecutionMonitor
Report the number of messages ready for processing by the handler in the current run

Specified by:
setNumMessages in interface MessageHandlerExecutionMonitor
Parameters:
count - number of messages ready for processing by the handler in the current run

getNumMessages

public int getNumMessages()

getNumMessagesRejected

public int getNumMessagesRejected()

getErrorMessages

public Iterable<String> getErrorMessages()


Copyright © 2002-2012 Atlassian. All Rights Reserved.