Package rs.mail.queue

Class MailQueueAdapter

java.lang.Object
rs.mail.queue.MailQueueAdapter
All Implemented Interfaces:
MailQueueListener

public class MailQueueAdapter extends Object implements MailQueueListener
Default implementation of the MailQueueListener interface.

This implementation only writes the information into the log (debug, info and error).

Author:
ralph
  • Constructor Details

    • MailQueueAdapter

      public MailQueueAdapter()
      Constructor.
    • MailQueueAdapter

      public MailQueueAdapter(org.slf4j.Logger log)
      Constructor.
      Parameters:
      log - - external logger to be used
  • Method Details

    • getLog

      public org.slf4j.Logger getLog()
      Returns the log.
      Returns:
      the log
    • onQueued

      public void onQueued(String referenceId)
      Informs that a message was added to the queue.
      Specified by:
      onQueued in interface MailQueueListener
      Parameters:
      referenceId - - the reference ID of the message
    • onSending

      public void onSending(String referenceId)
      Informs that the message is now being sent.
      Specified by:
      onSending in interface MailQueueListener
      Parameters:
      referenceId - - the reference ID of the message
    • onSent

      public void onSent(String referenceId)
      Informs that a message was sent successfully.
      Specified by:
      onSent in interface MailQueueListener
      Parameters:
      referenceId - - the reference ID of the message
    • onFailed

      public void onFailed(String referenceId, int failedAttempts, String reason)
      Informs that a message could not be sent.
      Specified by:
      onFailed in interface MailQueueListener
      Parameters:
      referenceId - - the reference ID of the message
      failedAttempts - - the number of failed attempts
      reason - - reason string why it failed