| java.lang.Object org.apache.james.core.MailImpl
MailImpl | public class MailImpl implements Disposable,Mail(Code) | | Wraps a MimeMessage adding routing information (from SMTP) and some simple
API enhancements.
From James version > 2.2.0a8 "mail attributes" have been added.
Backward and forward compatibility is supported:
messages stored in file repositories without attributes by James version <= 2.2.0a8
will be processed by later versions as having an empty attributes hashmap;
messages stored in file repositories with attributes by James version > 2.2.0a8
will be processed by previous versions, ignoring the attributes.
version: CVS $Revision: 494012 $ $Date: 2007-01-08 11:23:58 +0100 (Mo, 08 Jan 2007) $ |
Constructor Summary | |
public | MailImpl() | public | MailImpl(String name, MailAddress sender, Collection recipients) A constructor that creates a MailImpl with the specified name,
sender, and recipients. | public | MailImpl(Mail mail, String newName) | public | MailImpl(String name, MailAddress sender, Collection recipients, InputStream messageIn) A constructor that creates a MailImpl with the specified name,
sender, recipients, and message data. | public | MailImpl(String name, MailAddress sender, Collection recipients, MimeMessage message) A constructor that creates a MailImpl with the specified name,
sender, recipients, and MimeMessage. | public | MailImpl(MimeMessage message) A constructor which will attempt to obtain sender and recipients from the headers of the MimeMessage supplied. |
serialVersionUID | final public static long serialVersionUID(Code) | | We hardcode the serialVersionUID so that from James 1.2 on,
MailImpl will be deserializable (so your mail doesn't get lost)
|
MailImpl | public MailImpl()(Code) | | A constructor that creates a new, uninitialized MailImpl
|
MailImpl | public MailImpl(String name, MailAddress sender, Collection recipients)(Code) | | A constructor that creates a MailImpl with the specified name,
sender, and recipients.
Parameters: name - the name of the MailImpl Parameters: sender - the sender for this MailImpl Parameters: recipients - the collection of recipients of this MailImpl |
MailImpl | public MailImpl(Mail mail, String newName) throws MessagingException(Code) | | Parameters: mail - Parameters: newName - throws: MessagingException - |
MailImpl | public MailImpl(String name, MailAddress sender, Collection recipients, InputStream messageIn) throws MessagingException(Code) | | A constructor that creates a MailImpl with the specified name,
sender, recipients, and message data.
Parameters: name - the name of the MailImpl Parameters: sender - the sender for this MailImpl Parameters: recipients - the collection of recipients of this MailImpl Parameters: messageIn - a stream containing the message source |
MailImpl | public MailImpl(String name, MailAddress sender, Collection recipients, MimeMessage message) throws MessagingException(Code) | | A constructor that creates a MailImpl with the specified name,
sender, recipients, and MimeMessage.
Parameters: name - the name of the MailImpl Parameters: sender - the sender for this MailImpl Parameters: recipients - the collection of recipients of this MailImpl Parameters: message - the MimeMessage associated with this MailImpl |
MailImpl | public MailImpl(MimeMessage message) throws MessagingException(Code) | | A constructor which will attempt to obtain sender and recipients from the headers of the MimeMessage supplied.
Parameters: message - - a MimeMessage from which to construct a Mail |
dispose | public void dispose()(Code) | | See Also: org.apache.avalon.framework.activity.Disposable.dispose |
duplicate | public Mail duplicate()(Code) | | Duplicate the MailImpl.
a MailImpl that is a duplicate of this one |
duplicate | public Mail duplicate(String newName)(Code) | | Duplicate the MailImpl, replacing the mail name with the one
passed in as an argument.
Parameters: newName - the name for the duplicated mail a MailImpl that is a duplicate of this one with a different name |
getAttributesRaw | public HashMap getAttributesRaw()(Code) | | This method is necessary, when Mail repositories needs to deal
explicitly with storing Mail attributes as a Serializable
Note: This method is not exposed in the Mail interface,
it is for internal use by James only.
Serializable of the entire attributes collection since: 2.2.0 |
getErrorMessage | public String getErrorMessage()(Code) | | Get the error message associated with this MailImpl.
the error message associated with this MailImpl |
getLastUpdated | public Date getLastUpdated()(Code) | | Get the last updated time for this MailImpl.
the last updated time for this MailImpl |
getMessage | public MimeMessage getMessage() throws MessagingException(Code) | | Get the MimeMessage associated with this MailImpl.
the MimeMessage associated with this MailImpl |
getMessageSize | public long getMessageSize() throws MessagingException(Code) | | Return the size of the message including its headers.
MimeMessage.getSize() method only returns the size of the
message body.
Note: this size is not guaranteed to be accurate - see Sun's
documentation of MimeMessage.getSize().
approximate size of full message including headers. throws: MessagingException - if a problem occurs while computing the message size |
getName | public String getName()(Code) | | Get the name of this MailImpl.
the name of this MailImpl |
getRecipients | public Collection getRecipients()(Code) | | Get the recipients of this MailImpl.
the recipients of this MailImpl |
getRemoteAddr | public String getRemoteAddr()(Code) | | Get the remote address associated with this MailImpl.
the remote address associated with this MailImpl |
getRemoteHost | public String getRemoteHost()(Code) | | Get the remote host associated with this MailImpl.
the remote host associated with this MailImpl |
getSender | public MailAddress getSender()(Code) | | Get the sender of this MailImpl.
the sender of this MailImpl |
getState | public String getState()(Code) | | Get the state of this MailImpl.
the state of this MailImpl |
setAttributesRaw | public void setAttributesRaw(HashMap attr)(Code) | | This method is necessary, when Mail repositories needs to deal
explicitly with retriving Mail attributes as a Serializable
Note: This method is not exposed in the Mail interface,
it is for internal use by James only.
Serializable of the entire attributes collection since: 2.2.0 |
setErrorMessage | public void setErrorMessage(String msg)(Code) | | Set the error message associated with this MailImpl.
Parameters: msg - the new error message associated with this MailImpl |
setLastUpdated | public void setLastUpdated(Date lastUpdated)(Code) | | Set the date this mail was last updated.
Parameters: lastUpdated - the date the mail was last updated |
setMessage | public void setMessage(MimeMessage message)(Code) | | Set the MimeMessage associated with this MailImpl.
Parameters: message - the new MimeMessage associated with this MailImpl |
setName | public void setName(String name)(Code) | | Set the name of this MailImpl.
Parameters: name - the name of this MailImpl |
setRecipients | public void setRecipients(Collection recipients)(Code) | | Set the recipients for this MailImpl.
Parameters: recipients - the recipients for this MailImpl |
setRemoteAddr | public void setRemoteAddr(String remoteAddr)(Code) | | Set the remote address associated with this MailImpl.
Parameters: remoteAddr - the new remote address associated with this MailImpl |
setRemoteHost | public void setRemoteHost(String remoteHost)(Code) | | Set the remote address associated with this MailImpl.
Parameters: remoteHost - the new remote host associated with this MailImpl |
setSender | public void setSender(MailAddress sender)(Code) | | Set the sender of this MailImpl.
Parameters: sender - the sender of this MailImpl |
setState | public void setState(String state)(Code) | | Set the state of this MailImpl.
Parameters: state - the state of this MailImpl |
writeMessageTo | public void writeMessageTo(OutputStream out) throws IOException, MessagingException(Code) | | Writes the message out to an OutputStream.
Parameters: out - the OutputStream to which to write the content throws: MessagingException - if the MimeMessage is not set for this MailImpl throws: IOException - if an error occurs while reading or writing from the stream |
|
|