org.apache.servlet.mail
Interface MailServletRequest


public abstract interface MailServletRequest
extends javax.servlet.ServletRequest

This interface defines the methods needed by the mail servlet to gather information about the mail message that has been posted and routed to the called mail servlet.

Some methods found in ServletRequest are redefined here for more specific behavior in mail handling. The other methods behave like in other servlet paradigms.

Version:
pre-draft 1.0 (submitted for review)
Author:
Stefano Mazzocchi , Pierpaolo Fumagalli

Method Summary
 int getContentLength()
          Returns the length of the body of the posted mail message without headers and additional information.
 MailHeaders getHeaders()
          Returns an object encapsulating all the mail headers.
 javax.servlet.ServletInputStream getInputStream()
          Returns the binary input stream associated with the body of the message (headers are skipped)
 java.lang.String getProtocol()
          Returns the protocol used to send the mail message. (i.e.
 java.io.BufferedReader getReader()
          Returns the reader associated with the body of the message.
 MailAddress[] getRecipients()
          Returns an array of fully qualified mail addresses of the recipients of this mail message.
 java.lang.String getRemoteAddr()
          Returns the IP address of the host returned by getRemoteHost()
 java.lang.String getRemoteHost()
          Returns the fully qualified name of the last host that handled the mail message (the one performing this request)
 java.lang.String getScheme()
          Same as getProtocol() (this is due to the fact that there is no standard URL for mail handling: should we define one?
 MailAddress getSender()
          Returns the fully qualified mail address of the sender.
 MailAddress getServletAddress()
          Returns the name of the mail address that received the mail request.
 
Methods inherited from interface javax.servlet.ServletRequest
getAttribute, getCharacterEncoding, getContentType, getParameter, getParameterNames, getParameterValues, getRealPath, getServerName, getServerPort
 

Method Detail

getContentLength

public int getContentLength()
Returns the length of the body of the posted mail message without headers and additional information.
Specified by:
getContentLength in interface javax.servlet.ServletRequest

getInputStream

public javax.servlet.ServletInputStream getInputStream()
                                                throws java.io.IOException
Returns the binary input stream associated with the body of the message (headers are skipped)
Specified by:
getInputStream in interface javax.servlet.ServletRequest

getProtocol

public java.lang.String getProtocol()
Returns the protocol used to send the mail message. (i.e. SMTP, ESMTP, whatever comes next...)
Specified by:
getProtocol in interface javax.servlet.ServletRequest

getReader

public java.io.BufferedReader getReader()
                                 throws java.io.IOException
Returns the reader associated with the body of the message.
Specified by:
getReader in interface javax.servlet.ServletRequest

getRemoteHost

public java.lang.String getRemoteHost()
Returns the fully qualified name of the last host that handled the mail message (the one performing this request)
Specified by:
getRemoteHost in interface javax.servlet.ServletRequest

getRemoteAddr

public java.lang.String getRemoteAddr()
Returns the IP address of the host returned by getRemoteHost()
Specified by:
getRemoteAddr in interface javax.servlet.ServletRequest

getScheme

public java.lang.String getScheme()
Same as getProtocol() (this is due to the fact that there is no standard URL for mail handling: should we define one? what about something like mail://host/user/folder?Subject="Hi")
Specified by:
getScheme in interface javax.servlet.ServletRequest

getServletAddress

public MailAddress getServletAddress()
Returns the name of the mail address that received the mail request.

getSender

public MailAddress getSender()
Returns the fully qualified mail address of the sender.

getRecipients

public MailAddress[] getRecipients()
Returns an array of fully qualified mail addresses of the recipients of this mail message.

getHeaders

public MailHeaders getHeaders()
Returns an object encapsulating all the mail headers.