|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Wrap a MimeMessage with routing information (from SMTP) such as SMTP specified recipients, sender, and ip address and hostname of sending server. It also contains its state which represents which processor in the mailet container it is currently running. Special processor names are "root" and "error".
Field Summary | |
static String |
DEFAULT
|
static String |
ERROR
|
static String |
GHOST
|
static String |
TRANSPORT
|
Method Summary | |
Serializable |
getAttribute(String name)
Returns the Mail session attribute with the given name, or null if there is no attribute by that name. |
Iterator |
getAttributeNames()
Returns an Iterator containing the attribute names currently available within this Mail instance. |
String |
getErrorMessage()
The error message, if any, associated with this message. |
MimeMessage |
getMessage()
Returns the MimeMessage stored in this message |
Collection |
getRecipients()
Returns a Collection of MailAddress objects that are recipients of this message |
String |
getRemoteAddr()
The remote ip address of the server that connected to send this message |
String |
getRemoteHost()
The remote hostname of the server that connected to send this message |
MailAddress |
getSender()
The sender of the message, as specified by the MAIL FROM header, or internally defined |
String |
getState()
The current state of the message, such as GHOST, ERROR, or DEFAULT |
boolean |
hasAttributes()
|
void |
removeAllAttributes()
Removes all the attributes associated with this Mail instance. |
Serializable |
removeAttribute(String name)
Removes the attribute with the given name from this Mail instance. |
Serializable |
setAttribute(String name,
Serializable object)
Binds an object to a given attribute name in this Mail instance. |
void |
setErrorMessage(String msg)
Sets the error message associated with this message. |
void |
setMessage(MimeMessage message)
Sets the MimeMessage associated with this message via the object. |
void |
setState(String state)
Sets the state of this message. |
Field Detail |
public static final String GHOST
public static final String DEFAULT
public static final String ERROR
public static final String TRANSPORT
Method Detail |
public MimeMessage getMessage() throws MessagingException
MessagingException
- - an error occured while loading this objectpublic Collection getRecipients()
public MailAddress getSender()
public String getState()
public String getRemoteHost()
public String getRemoteAddr()
public String getErrorMessage()
public void setErrorMessage(String msg)
msg
- - a descriptive error messagepublic void setMessage(MimeMessage message)
message
- - the new MimeMessage that this Mail object will wrappublic void setState(String state)
state
- - the new state of this messagepublic Serializable getAttribute(String name)
A list of currently set attributes can be retrieved using getAttributeNames.
The attribute is returned as a java.lang.Object or some subclass. Attribute names should follow the same convention as package names. The Java Mailet API specification reserves names matching java.*, javax.*, and sun.*
name
- - a String specifying the name of the attribute
public Iterator getAttributeNames()
public boolean hasAttributes()
public Serializable removeAttribute(String name)
name
- - a String specifying the name of the attribute to be removed
public void removeAllAttributes()
public Serializable setAttribute(String name, Serializable object)
Attribute names should follow the same convention as package names. The Mailet API specification reserves names matching org.apache.james.* and org.apache.mailet.*.
name
- - a String specifying the name of the attributeobject
- - a Serializable Object representing the attribute to be bound
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |