| org.apache.mailet.Mail
All known Subclasses: org.apache.james.core.MailImpl, org.apache.james.test.mock.mailet.MockMail,
Mail | public interface Mail extends Serializable,Cloneable(Code) | | 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".
version: CVS $Revision: 494012 $ $Date: 2007-01-08 11:23:58 +0100 (Mo, 08 Jan 2007) $ |
getAttribute | Serializable getAttribute(String name)(Code) | | Returns the Mail session attribute with the given name, or null
if there is no attribute by that name.
An attribute allows a mailet to give this Mail instance additional information
not already provided by this interface.
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 Mailet API
specification reserves names matching org.apache.james.*
and org.apache.mailet.*.
Parameters: name - - a String specifying the name of the attribute an Object containing the value of the attribute, or null if no attributeexists matching the given name since: Mailet API v2.1 |
getAttributeNames | Iterator getAttributeNames()(Code) | | Returns an Iterator containing the attribute names currently available within
this Mail instance. Use the getAttribute(java.lang.String) method with an
attribute name to get the value of an attribute.
an Iterator of attribute names since: Mailet API v2.1 |
getErrorMessage | String getErrorMessage()(Code) | | The error message, if any, associated with this message. Not sure why this is needed.
a String of a descriptive error message |
getLastUpdated | Date getLastUpdated()(Code) | | the last update date since: Mailet API v2.3 |
getMessage | MimeMessage getMessage() throws MessagingException(Code) | | Returns the MimeMessage stored in this message
the MimeMessage that this Mail object wraps throws: MessagingException - - an error occured while loading this object |
getMessageSize | long getMessageSize() throws MessagingException(Code) | | message size since: Mailet API v2.3 |
getName | String getName()(Code) | | Returns the message name of this message
the message name since: Mailet API v2.3 |
getRecipients | Collection getRecipients()(Code) | | Returns a Collection of MailAddress objects that are recipients of this message
a Collection of MailAddress objects that are recipients of this message |
getRemoteAddr | String getRemoteAddr()(Code) | | The remote ip address of the server that connected to send this message
a String of the ip address of the server that connected to send this message |
getRemoteHost | String getRemoteHost()(Code) | | The remote hostname of the server that connected to send this message
a String of the hostname of the server that connected to send this message |
getSender | MailAddress getSender()(Code) | | The sender of the message, as specified by the MAIL FROM header, or internally defined
a MailAddress of the sender of this message |
getState | String getState()(Code) | | The current state of the message, such as GHOST, ERROR, or DEFAULT
the state of this message |
hasAttributes | boolean hasAttributes()(Code) | | true if this Mail instance has any attributes set. since: Mailet API v2.1 |
removeAllAttributes | void removeAllAttributes()(Code) | | Removes all the attributes associated with this Mail instance.
since: Mailet API v2.1 |
removeAttribute | Serializable removeAttribute(String name)(Code) | | Removes the attribute with the given name from this Mail instance. After
removal, subsequent calls to getAttribute(java.lang.String) to retrieve
the attribute's value will return null.
Parameters: name - - a String specifying the name of the attribute to be removed previous attribute value associated with specified name, or nullif there was no mapping for name (null can also mean that nullwas bound to the name) since: Mailet API v2.1 |
setAttribute | Serializable setAttribute(String name, Serializable object)(Code) | | Binds an object to a given attribute name in this Mail instance. If the name
specified is already used for an attribute, this method will remove the old
attribute and bind the name to the new attribute.
As instances of Mail is Serializable, it is necessary that the attributes being
Serializable as well
Attribute names should follow the same convention as package names.
The Mailet API specification reserves names matching org.apache.james.*
and org.apache.mailet.*.
Parameters: name - - a String specifying the name of the attribute Parameters: object - - a Serializable Object representing the attribute to be bound the object previously bound to the name, null if the name wasnot bound (null can also mean that null was bound to the name) since: Mailet API v2.1 |
setErrorMessage | void setErrorMessage(String msg)(Code) | | Sets the error message associated with this message. Not sure why this is needed.
Parameters: msg - - a descriptive error message |
setLastUpdated | void setLastUpdated(Date lastUpdated)(Code) | | Parameters: lastUpdated - the new last updated date since: Mailet API v2.3 |
setMessage | void setMessage(MimeMessage message)(Code) | | Sets the MimeMessage associated with this message via the object.
Parameters: message - - the new MimeMessage that this Mail object will wrap |
setName | void setName(String newName)(Code) | | Set the message name of this message
Parameters: newName - new name since: Mailet API v2.3 |
setRecipients | void setRecipients(Collection recipients)(Code) | | Method setRecipients.
Parameters: recipients - a Collection of MailAddress Objects representing the recipients of this message since: Mailet API v3.0-unstable |
setState | void setState(String state)(Code) | | Sets the state of this message.
Parameters: state - - the new state of this message |
|
|