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 CURRENT_HELO_NAME
           
static java.lang.Object CURRENT_RECIPIENT
           
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.util.Map getConnectionState()
          Returns Map that consists of the state of the SMTPSession per connection
 java.io.InputStream getInputStream()
          Returns Inputstream for handling messages and commands
 org.apache.mailet.Mail getMail()
          Returns Mail object for message handlers to process
 int getRcptCount()
          Returns the recipient count
 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.Map getState()
          Returns Map that consists of the state of the SMTPSession per mail
 boolean getStopHandlerProcessing()
          Return if handlerprocessing should be stopped
 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 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 resetConnectionState()
          Reset the Connection state
 void resetState()
          Resets message-specific, but not authenticated user, state.
 void setMail(org.apache.mailet.Mail mail)
          Sets the MailImpl object for further processing
 void setRelayingAllowed(boolean relayingAllowed)
          Set if reallying is allowed
 void setStopHandlerProcessing(boolean b)
          Set to true if the handlerprocessing should be stopped
 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

CURRENT_HELO_NAME

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

CURRENT_RECIPIENT

static final java.lang.Object CURRENT_RECIPIENT
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

org.apache.mailet.Mail getMail()
Returns Mail object for message handlers to process

Returns:
Mail object

setMail

void setMail(org.apache.mailet.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.Map getState()
Returns Map that consists of the state of the SMTPSession per mail

Returns:
map of the current SMTPSession state per mail

resetState

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


getConfigurationData

SMTPHandlerConfigurationData getConfigurationData()
Returns SMTPHandler service wide configuration

Returns:
SMTPHandlerConfigurationData

isRelayingAllowed

boolean isRelayingAllowed()
Returns whether Relaying is allowed or not

Returns:
the relaying status

setRelayingAllowed

void setRelayingAllowed(boolean relayingAllowed)
Set if reallying is allowed

Parameters:
relayingAllowed -

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:
user - 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

getRcptCount

int getRcptCount()
Returns the recipient count

Returns:
recipient count

setStopHandlerProcessing

void setStopHandlerProcessing(boolean b)
Set to true if the handlerprocessing should be stopped

Parameters:
b - true or false

getStopHandlerProcessing

boolean getStopHandlerProcessing()
Return if handlerprocessing should be stopped

Returns:
true or false

resetConnectionState

void resetConnectionState()
Reset the Connection state


getConnectionState

java.util.Map getConnectionState()
Returns Map that consists of the state of the SMTPSession per connection

Returns:
map of the current SMTPSession state per connection


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