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 java.lang.String CURRENT_HELO_MODE
           
static java.lang.String MESG_FAILED
           
static java.lang.String RCPT_LIST
           
static java.lang.String SENDER
           
 
Method Summary
 void abortMessage()
          this makes the message to be dropped inprotocol
 java.lang.String clearResponseBuffer()
          Clears the response buffer, returning the String of characters in the buffer.
 void endSession()
          this makes the session to close
 java.lang.String getCommandArgument()
          Returns currently process command argument
 java.lang.String getCommandName()
          Returns currently process command name
 SMTPHandlerConfigurationData getConfigurationData()
          Returns SMTPHandler service wide configuration
 java.io.InputStream getInputStream()
          Returns Inputstream for handling messages and commands
 Mail getMail()
          Returns Mail object for message handlers to process
 java.lang.String getRemoteHost()
          Returns host name of the client
 java.lang.String getRemoteIPAddress()
          Returns host ip address of the client
 java.lang.StringBuffer getResponseBuffer()
          Returns ResponseBuffer, this optimizes the unecessary creation of resources by each handler object
 java.lang.String getSessionID()
          Returns the SMTP session id
 java.util.HashMap getState()
          Returns Map that consists of the state of the SMTPSession
 java.lang.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
 java.lang.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(java.lang.String user)
          Sets the user name associated with this SMTP interaction.
 boolean useHeloEhloEnforcement()
          Returns whether remote server needs to send HELO/EHLO
 void writeResponse(java.lang.String respString)
          Writes response string to the client
 

Field Detail

MESG_FAILED

static final java.lang.String MESG_FAILED
See Also:
Constant Field Values

SENDER

static final java.lang.String SENDER
See Also:
Constant Field Values

RCPT_LIST

static final java.lang.String RCPT_LIST
See Also:
Constant Field Values

CURRENT_HELO_MODE

static final java.lang.String CURRENT_HELO_MODE
See Also:
Constant Field Values
Method Detail

writeResponse

void writeResponse(java.lang.String respString)
Writes response string to the client

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

readCommandLine

java.lang.String readCommandLine()
                                 throws java.io.IOException
Reads a line of characters off the command line.

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

getResponseBuffer

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

Returns:
responseBuffer

clearResponseBuffer

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

Returns:
the data in the response buffer

getInputStream

java.io.InputStream getInputStream()
Returns Inputstream for handling messages and commands

Returns:
InputStream object

getCommandName

java.lang.String getCommandName()
Returns currently process command name

Returns:
current command name

getCommandArgument

java.lang.String getCommandArgument()
Returns currently process command argument

Returns:
current command argument

getMail

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

Returns:
Mail object

setMail

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

Parameters:
mail - MailImpl object

getRemoteHost

java.lang.String getRemoteHost()
Returns host name of the client

Returns:
hostname of the client

getRemoteIPAddress

java.lang.String getRemoteIPAddress()
Returns host ip address of the client

Returns:
host ip address of the client

abortMessage

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


endSession

void endSession()
this makes the session to close


isSessionEnded

boolean isSessionEnded()
Returns the session status

Returns:
if the session is open or closed

getState

java.util.HashMap getState()
Returns Map that consists of the state of the SMTPSession

Returns:
map of the current SMTPSession state

resetState

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


getConfigurationData

SMTPHandlerConfigurationData getConfigurationData()
Returns SMTPHandler service wide configuration

Returns:
SMTPHandlerConfigurationData

setBlockListed

void setBlockListed(boolean blocklisted)
Sets the blocklisted value

Parameters:
blocklisted -

isBlockListed

boolean isBlockListed()
Returns the blocklisted status

Returns:
blocklisted

isRelayingAllowed

boolean isRelayingAllowed()
Returns whether Relaying is allowed or not

Returns:
the relaying status

isAuthRequired

boolean isAuthRequired()
Returns whether Authentication is required or not

Returns:
authentication required or not

useHeloEhloEnforcement

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

Returns:
HELO/EHLO required or not

getUser

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

Returns:
the user name

setUser

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

Parameters:
userID - the user name

getWatchdog

Watchdog getWatchdog()
Returns Watchdog object used for handling timeout

Returns:
Watchdog object

getSessionID

java.lang.String getSessionID()
Returns the SMTP session id

Returns:
SMTP session id


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.