|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
org.subethamail.smtp.server.Session
public class Session
The thread that handles a connection. This class passes most of it's responsibilities off to the CommandHandler.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
Session(SMTPServer server,
java.net.Socket socket)
Creates (but does not start) the thread object. |
Method Summary | |
---|---|
void |
addRecipient()
|
void |
closeSocket()
Close the client socket if it is open |
AuthenticationHandler |
getAuthenticationHandler()
|
boolean |
getHasMailFrom()
Simple state |
MessageHandler |
getMessageHandler()
|
java.io.InputStream |
getRawInput()
|
CRLFTerminatedReader |
getReader()
|
int |
getRecipientCount()
|
java.net.SocketAddress |
getRemoteAddress()
|
SMTPServer |
getServer()
|
SMTPServer |
getSMTPServer()
|
java.net.Socket |
getSocket()
This method is only used by the start tls command |
boolean |
isAuthenticated()
|
void |
quit()
Triggers the shutdown of the thread and the closing of the connection. |
void |
resetMessageState()
Some state is associated with each particular message (senders, recipients, the message handler). |
void |
run()
The thread for each session runs on this and shuts down when the shutdown member goes true. |
void |
sendResponse(java.lang.String response)
Sends the response to the client |
void |
setAuthenticationHandler(AuthenticationHandler handler)
This is called by the AuthCommand when a session is successfully authenticated. |
void |
setHasMailFrom(boolean value)
|
void |
setSocket(java.net.Socket socket)
Initializes our reader, writer, and the i/o filter chains based on the specified socket. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Session(SMTPServer server, java.net.Socket socket) throws java.io.IOException
server
- a link to our parentsocket
- is the socket to the client
java.io.IOException
Method Detail |
---|
public SMTPServer getServer()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void setSocket(java.net.Socket socket) throws java.io.IOException
java.io.IOException
public java.net.Socket getSocket()
public void closeSocket() throws java.io.IOException
java.io.IOException
public java.io.InputStream getRawInput()
public CRLFTerminatedReader getReader()
public void sendResponse(java.lang.String response) throws java.io.IOException
java.io.IOException
public java.net.SocketAddress getRemoteAddress()
getRemoteAddress
in interface MessageContext
public SMTPServer getSMTPServer()
getSMTPServer
in interface MessageContext
public MessageHandler getMessageHandler()
public boolean getHasMailFrom()
public void setHasMailFrom(boolean value)
public void addRecipient()
public int getRecipientCount()
public boolean isAuthenticated()
public AuthenticationHandler getAuthenticationHandler()
getAuthenticationHandler
in interface MessageContext
public void setAuthenticationHandler(AuthenticationHandler handler)
public void resetMessageState()
public void quit()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |