com.admc.jamama.server.smtp
Class Session

java.lang.Object
  extended bycom.admc.jamama.server.smtp.Session

public class Session
extends java.lang.Object

Handles a single client SMTP connection.

Version:
$Revision: 1.6 $
Author:
Blaine Simpson

Field Summary
static int STATE_DATA
          State of the SMTP connection
static int STATE_DISCONNECTED
          State of the SMTP connection
static int STATE_GREETED
          State of the SMTP connection
static int STATE_MAIL
          State of the SMTP connection
static int STATE_PREGREET
          State of the SMTP connection
static int STATE_RCPT
          State of the SMTP connection
 
Constructor Summary
Session(java.net.Socket inSocket, Director inDirector)
           
 
Method Summary
 java.lang.String getData()
          Get all data lines for this SMTP data command.
 java.lang.String getLine()
          Get one line of text from the SMTP pipe.
 void handle()
          Main method in this class.
 void send(int i, java.lang.String inText)
          Write a status code and string to SMTP pipe.
 void send(java.lang.String inCommand)
          Write a string to SMTP pipe.
 void setDebug(boolean inDebug)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_DISCONNECTED

public static final int STATE_DISCONNECTED
State of the SMTP connection

See Also:
Constant Field Values

STATE_PREGREET

public static final int STATE_PREGREET
State of the SMTP connection

See Also:
Constant Field Values

STATE_GREETED

public static final int STATE_GREETED
State of the SMTP connection

See Also:
Constant Field Values

STATE_MAIL

public static final int STATE_MAIL
State of the SMTP connection

See Also:
Constant Field Values

STATE_RCPT

public static final int STATE_RCPT
State of the SMTP connection

See Also:
Constant Field Values

STATE_DATA

public static final int STATE_DATA
State of the SMTP connection

See Also:
Constant Field Values
Constructor Detail

Session

public Session(java.net.Socket inSocket,
               Director inDirector)
Method Detail

setDebug

public void setDebug(boolean inDebug)

handle

public void handle()
            throws JamamaException
Main method in this class.

Throws:
JamamaException

send

public void send(java.lang.String inCommand)
          throws java.io.IOException
Write a string to SMTP pipe.

Throws:
java.io.IOException

send

public void send(int i,
                 java.lang.String inText)
          throws java.io.IOException
Write a status code and string to SMTP pipe.

Parameters:
i - SMTP status code to transmit
inText - Text to transmit
Throws:
java.io.IOException

getData

public java.lang.String getData()
                         throws java.io.IOException
Get all data lines for this SMTP data command. TODO: Limit size unless size given ahead-of-time, so that we can re-use a buffer. Otherwise, we'll use up all of our RAM.

Throws:
java.io.IOException

getLine

public java.lang.String getLine()
                         throws java.io.IOException
Get one line of text from the SMTP pipe.

Throws:
java.io.IOException