org.apache.james.smtpserver
Interface SMTPSession

All Known Implementing Classes:
SMTPHandler

public interface SMTPSession

All the handlers access this interface to communicate with SMTPHandler object


Field Summary
static String CURRENT_HELO_MODE
           
static String MESG_FAILED
           
static String RCPT_LIST
           
static String SENDER
           
 
Method Summary
 void abortMessage()
          this makes the message to be dropped inprotocol
 String clearResponseBuffer()
          Clears the response buffer, returning the String of characters in the buffer.
 void endSession()
          this makes the session to close
 String getCommandArgument()
          Returns currently process command argument
 String getCommandName()
          Returns currently process command name
 SMTPHandlerConfigurationData getConfigurationData()
          Returns SMTPHandler service wide configuration
 InputStream getInputStream()
          Returns Inputstream for handling messages and commands
 Mail getMail()
          Returns Mail object for message handlers to process
 String getRemoteHost()
          Returns host name of the client
 String getRemoteIPAddress()
          Returns host ip address of the client
 StringBuffer getResponseBuffer()
          Returns ResponseBuffer, this optimizes the unecessary creation of resources by each handler object
 String getSessionID()
          Returns the SMTP session id
 HashMap getState()
          Returns Map that consists of the state of the SMTPSession
 String getUser()
          Returns the user name associated with this SMTP interaction.
 Watchdog getWatchdog()
          Returns Watchdog object used for handling timeout
 boolean isAuthRequired()
          Returns whether Authentication is required or not
 boolean isBlockListed()
          Returns the blocklisted status
 boolean isRelayingAllowed()
          Returns whether Relaying is allowed or not
 boolean isSessionEnded()
          Returns the session status
 String readCommandLine()
          Reads a line of characters off the command line.
 void resetState()
          Resets message-specific, but not authenticated user, state.
 void setBlockListed(boolean blocklisted)
          Sets the blocklisted value
 void setMail(Mail mail)
          Sets the MailImpl object for further processing
 void setUser(String user)
          Sets the user name associated with this SMTP interaction.
 boolean useHeloEhloEnforcement()
          Returns whether remote server needs to send HELO/EHLO
 void writeResponse(String respString)
          Writes response string to the client
 

Field Detail

MESG_FAILED

public static final String MESG_FAILED
See Also:
Constant Field Values

SENDER

public static final String SENDER
See Also:
Constant Field Values

RCPT_LIST

public static final String RCPT_LIST
See Also:
Constant Field Values

CURRENT_HELO_MODE

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

writeResponse

public void writeResponse(String respString)
Writes response string to the client

Parameters:
respString - String that needs to send to the client

readCommandLine

public String readCommandLine()
                       throws IOException
Reads a line of characters off the command line.

Returns:
the trimmed input line
Throws:
IOException - if an exception is generated reading in the input characters

getResponseBuffer

public StringBuffer getResponseBuffer()
Returns ResponseBuffer, this optimizes the unecessary creation of resources by each handler object

Returns:
responseBuffer

clearResponseBuffer

public String clearResponseBuffer()
Clears the response buffer, returning the String of characters in the buffer.

Returns:
the data in the response buffer

getInputStream

public InputStream getInputStream()
Returns Inputstream for handling messages and commands

Returns:
InputStream object

getCommandName

public String getCommandName()
Returns currently process command name

Returns:
current command name

getCommandArgument

public String getCommandArgument()
Returns currently process command argument

Returns:
current command argument

getMail

public Mail getMail()
Returns Mail object for message handlers to process

Returns:
Mail object

setMail

public void setMail(Mail mail)
Sets the MailImpl object for further processing

Parameters:
mail - MailImpl object

getRemoteHost

public String getRemoteHost()
Returns host name of the client

Returns:
hostname of the client

getRemoteIPAddress

public String getRemoteIPAddress()
Returns host ip address of the client

Returns:
host ip address of the client

abortMessage

public void abortMessage()
this makes the message to be dropped inprotocol


endSession

public void endSession()
this makes the session to close


isSessionEnded

public boolean isSessionEnded()
Returns the session status

Returns:
if the session is open or closed

getState

public HashMap getState()
Returns Map that consists of the state of the SMTPSession

Returns:
map of the current SMTPSession state

resetState

public void resetState()
Resets message-specific, but not authenticated user, state.


getConfigurationData

public SMTPHandlerConfigurationData getConfigurationData()
Returns SMTPHandler service wide configuration

Returns:
SMTPHandlerConfigurationData

setBlockListed

public void setBlockListed(boolean blocklisted)
Sets the blocklisted value

Parameters:
blocklisted -

isBlockListed

public boolean isBlockListed()
Returns the blocklisted status

Returns:
blocklisted

isRelayingAllowed

public boolean isRelayingAllowed()
Returns whether Relaying is allowed or not

Returns:
the relaying status

isAuthRequired

public boolean isAuthRequired()
Returns whether Authentication is required or not

Returns:
authentication required or not

useHeloEhloEnforcement

public boolean useHeloEhloEnforcement()
Returns whether remote server needs to send HELO/EHLO

Returns:
HELO/EHLO required or not

getUser

public String getUser()
Returns the user name associated with this SMTP interaction.

Returns:
the user name

setUser

public void setUser(String user)
Sets the user name associated with this SMTP interaction.


getWatchdog

public Watchdog getWatchdog()
Returns Watchdog object used for handling timeout

Returns:
Watchdog object

getSessionID

public String getSessionID()
Returns the SMTP session id

Returns:
SMTP session id


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