org.apache.mailet
Interface Mail

All Superinterfaces:
Cloneable, Serializable
All Known Implementing Classes:
MailImpl

public interface Mail
extends Serializable, 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 String DEFAULT
           
static String ERROR
           
static String GHOST
           
static String TRANSPORT
           
 
Method Summary
 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
 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

GHOST

public static final String GHOST
See Also:
Constant Field Values

DEFAULT

public static final String DEFAULT
See Also:
Constant Field Values

ERROR

public static final String ERROR
See Also:
Constant Field Values

TRANSPORT

public static final String TRANSPORT
See Also:
Constant Field Values
Method Detail

getMessage

public MimeMessage getMessage()
                       throws MessagingException
Returns the MimeMessage stored in this message

Returns:
the MimeMessage that this Mail object wraps
Throws:
MessagingException - - an error occured while loading this object

getRecipients

public 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 String getState()
The current state of the message, such as GHOST, ERROR, or DEFAULT

Returns:
the state of this message

getRemoteHost

public 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 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 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(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(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(String state)
Sets the state of this message.

Parameters:
state - - the new state of this message


"Copyright © 1999-2002 Apache Jakarta Project. All Rights Reserved."