ePOST API

rice.email.proxy.mail
Class MovingMessage

java.lang.Object
  extended by rice.email.proxy.mail.MovingMessage

public class MovingMessage
extends java.lang.Object

Contains information for delivering a mime email.

Since a MovingMessage many be passed through many queues and handlers before it can be safely deleted, destruction it handled by reference counting. When an object first obtains a reference to a MovingMessage, it should immediately call #aquire(). As soon as it has finished processing, that object must call releaseContent(). For example usage, see foedus.processing.OutgoingImpl.


Constructor Summary
MovingMessage(Email email)
           
MovingMessage(Workspace workspace)
           
 
Method Summary
 void acquire()
           
 void addRecipient(MailAddress s)
           
 java.io.Reader getContent()
           
 Email getEmail()
           
 java.util.Iterator getRecipientIterator()
           
 Resource getResource()
           
 MailAddress getReturnPath()
           
 void readDotTerminatedContent(SmtpConnection conn, Environment env)
          Reads the contents of the stream until <CRLF>.<CRLF> is encountered.
 boolean readDotTerminatedContent(java.lang.String line, Environment env)
           
 void readFullContent(java.io.Reader in)
           
 void releaseContent()
           
 void removeRecipient(MailAddress s)
           
 void setReturnPath(MailAddress fromAddress)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MovingMessage

public MovingMessage(Workspace workspace)

MovingMessage

public MovingMessage(Email email)
Method Detail

getEmail

public Email getEmail()

getResource

public Resource getResource()
                     throws java.io.IOException
Throws:
java.io.IOException

getContent

public java.io.Reader getContent()
                          throws java.io.IOException
Throws:
java.io.IOException

acquire

public void acquire()

releaseContent

public void releaseContent()

getReturnPath

public MailAddress getReturnPath()

setReturnPath

public void setReturnPath(MailAddress fromAddress)

addRecipient

public void addRecipient(MailAddress s)

removeRecipient

public void removeRecipient(MailAddress s)

getRecipientIterator

public java.util.Iterator getRecipientIterator()

readFullContent

public void readFullContent(java.io.Reader in)
                     throws java.io.IOException
Throws:
java.io.IOException

readDotTerminatedContent

public void readDotTerminatedContent(SmtpConnection conn,
                                     Environment env)
                              throws java.io.IOException
Reads the contents of the stream until <CRLF>.<CRLF> is encountered.

It would be possible and prehaps desirable to prevent the adding of an unnecessary CRLF at the end of the message, but it hardly seems worth 30 seconds of effort.

Throws:
java.io.IOException

readDotTerminatedContent

public boolean readDotTerminatedContent(java.lang.String line,
                                        Environment env)
                                 throws java.io.IOException
Throws:
java.io.IOException

ePOST API

Copyright © 2001-2005 - Rice Pastry.