org.apache.mailet
Interface Mail

All Superinterfaces:
java.lang.Cloneable, java.io.Serializable
All Known Implementing Classes:
MailImpl

public interface Mail
extends java.io.Serializable, java.lang.Cloneable

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:
0.9
Author:
Federico Barbieri , Serge Knystautas

Field Summary
static java.lang.String DEFAULT
           
static java.lang.String ERROR
           
static java.lang.String GHOST
           
static java.lang.String TRANSPORT
           
 
Method Summary
 java.lang.String getErrorMessage()
          The error message, if any, associated with this message.
 javax.mail.internet.MimeMessage getMessage()
          Returns the MimeMessage stored in this message
 java.util.Collection getRecipients()
          Returns a Collection of MailAddress objects that are recipients of this message
 java.lang.String getRemoteAddr()
          The remote ip address of the server that connected to send this message
 java.lang.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
 java.lang.String getState()
          The current state of the message, such as GHOST, ERROR, or DEFAULT
 void setErrorMessage(java.lang.String msg)
          Sets the error message associated with this message.
 void setMessage(javax.mail.internet.MimeMessage message)
          Sets the MimeMessage associated with this message via the object.
 void setState(java.lang.String state)
          Sets the state of this message.
 

Field Detail

GHOST

public static final java.lang.String GHOST

DEFAULT

public static final java.lang.String DEFAULT

ERROR

public static final java.lang.String ERROR

TRANSPORT

public static final java.lang.String TRANSPORT
Method Detail

getMessage

public javax.mail.internet.MimeMessage getMessage()
                                           throws javax.mail.MessagingException
Returns the MimeMessage stored in this message
Returns:
the MimeMessage that this Mail object wraps
Throws:
javax.mail.MessagingException - - an error occured while loading this object

getRecipients

public java.util.Collection getRecipients()
Returns a Collection of MailAddress objects that are recipients of this message
Returns:
a Collection of MailAddress objects that are recipients of this message

getSender

public MailAddress getSender()
The sender of the message, as specified by the MAIL FROM header, or internally defined
Returns:
a MailAddress of the sender of this message

getState

public java.lang.String getState()
The current state of the message, such as GHOST, ERROR, or DEFAULT
Returns:
the state of this message

getRemoteHost

public java.lang.String getRemoteHost()
The remote hostname of the server that connected to send this message
Returns:
a String of the hostname of the server that connected to send this message

getRemoteAddr

public java.lang.String getRemoteAddr()
The remote ip address of the server that connected to send this message
Returns:
a String of the ip address of the server that connected to send this message

getErrorMessage

public java.lang.String getErrorMessage()
The error message, if any, associated with this message. Not sure why this is needed.
Returns:
a String of a descriptive error message

setErrorMessage

public void setErrorMessage(java.lang.String msg)
Sets the error message associated with this message. Not sure why this is needed.
Parameters:
msg - - a descriptive error message

setMessage

public void setMessage(javax.mail.internet.MimeMessage message)
Sets the MimeMessage associated with this message via the object.
Parameters:
message - - the new MimeMessage that this Mail object will wrap

setState

public void setState(java.lang.String state)
Sets the state of this message.
Parameters:
state - - the new state of this message


"Copyright © 2001 Apache Jakarta Project. All Rights Reserved."