org.apache.james.jms.builder
Class SimpleMailBuilder

java.lang.Object
  extended by org.apache.james.jms.builder.SimpleMailBuilder
All Implemented Interfaces:
MailBuilder

public class SimpleMailBuilder
extends java.lang.Object
implements MailBuilder

Basic implementation that builds Mail from basic non-mime ASCII mail. Naively uses the to header to determine the recipent and from to determine the sender.

Note this implementation is too simple to cope well with wild emails. It may be useful when dealing with generated ASCII emails.


Nested Class Summary
static interface SimpleMailBuilder.IdGenerator
           
static class SimpleMailBuilder.JamesIdGenerator
           
 
Constructor Summary
SimpleMailBuilder()
           
SimpleMailBuilder(SimpleMailBuilder.IdGenerator generator)
           
 
Method Summary
 org.apache.mailet.Mail build(java.lang.String text)
          Builds a Mail from the given text.
 java.lang.String toString()
          Renders suitably for logging.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleMailBuilder

public SimpleMailBuilder()

SimpleMailBuilder

public SimpleMailBuilder(SimpleMailBuilder.IdGenerator generator)
Method Detail

build

public org.apache.mailet.Mail build(java.lang.String text)
                             throws javax.mail.MessagingException
Description copied from interface: MailBuilder
Builds a Mail from the given text.

Specified by:
build in interface MailBuilder
Parameters:
text - message text
Returns:
Mail, not null
Throws:
javax.mail.MessagingException

toString

public java.lang.String toString()
Renders suitably for logging.

Overrides:
toString in class java.lang.Object
Returns:
a String representation of this object.


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.