com.ibm.commerce.emarketing.engine

Class SMTPSendThread

  • java.lang.Object
    • com.ibm.commerce.emarketing.engine.SMTPSendThread


  • public class SMTPSendThread
    extends java.lang.Object
    A Runnable class used to send email.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      Copyright.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.util.List getFailedRecipients()
      The method is used to get the list of failed recipients.
      long getFailureCount()
      The method help to get the Failure count for debug purpose.
      long getSuccessCount()
      The method help to get the success count for debug purpose.
      java.util.List getSuccessfulRecipients()
      The method is used to get the list of successful recipients.
      java.util.List getTargetQueue()
      The method is used to get the queue to store the message to be sent.
      java.lang.String getThreadName()
      The method is used to get the thread name.
      javax.mail.Transport getTransport()
      The method is used to get the message transport.
      boolean isFinished()
      The method tell if this thread is finish one run.
      void release()
      This method performs cleanup when the thread is destroyed.
      void run()
      Starts the thread.
      void setTransport(javax.mail.Transport theTransport)
      The method is used to set the message transport.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

    • Constructor Detail

      • SMTPSendThread

        public SMTPSendThread(javax.mail.internet.MimeMessage theMessage,
                              PersonalizedEmailContent thePEC,
                              PurgingStringBuffer theSuccessfulRecipientsPurgingBuffer,
                              java.lang.String theThreadName,
                              boolean recordResult)
        Constructor
        Parameters:
        theMessage - The MimeMessage object keeps the message to send.
        thePEC - The PersonalizedEmailContent object holds the content to send.
        theSuccessfulRecipientsPurgingBuffer - The PurgingStringBuffer object is used to store the successful recipient addresses.
        theThreadName - The string holds the name of this thread.
        recordResult - The boolean flag to tell if need to record the sending result.
    • Method Detail

      • getFailedRecipients

        public java.util.List getFailedRecipients()
        The method is used to get the list of failed recipients.
        Returns:
        the failed recipients.
      • getFailureCount

        public long getFailureCount()
        The method help to get the Failure count for debug purpose.
        Returns:
        the send count.
      • getSuccessCount

        public long getSuccessCount()
        The method help to get the success count for debug purpose.
        Returns:
        the send count.
      • getSuccessfulRecipients

        public java.util.List getSuccessfulRecipients()
        The method is used to get the list of successful recipients.
        Returns:
        the successful recipients.
      • getTargetQueue

        public java.util.List getTargetQueue()
        The method is used to get the queue to store the message to be sent.
        Returns:
        the queue.
      • getThreadName

        public java.lang.String getThreadName()
        The method is used to get the thread name.
        Returns:
        thread name.
      • getTransport

        public javax.mail.Transport getTransport()
        The method is used to get the message transport.
        Returns:
        the transport.
      • isFinished

        public boolean isFinished()
        The method tell if this thread is finish one run.
        Returns:
        true, if this thread is finish one run.
      • release

        public void release()
        This method performs cleanup when the thread is destroyed.
      • run

        public void run()
        Starts the thread. To avoid error for long run message sending, run the thread multiple times until it finish all the message in the queue, and every run only send a relative small number of messages. Depend on how fast the email server, send 128 messages can cost few secs to few mins.
      • setTransport

        public void setTransport(javax.mail.Transport theTransport)
        The method is used to set the message transport. To avoid message transport error for long-run, it is better for every run to use a new transport connection.
        Parameters:
        theTransport - the transport used for message sending.