com.ericdaugherty.mail.server.services.pop3
Class Pop3Processor

java.lang.Object
  extended by java.lang.Thread
      extended by com.ericdaugherty.mail.server.services.pop3.Pop3Processor
All Implemented Interfaces:
ConnectionProcessor, java.lang.Runnable

public class Pop3Processor
extends java.lang.Thread
implements ConnectionProcessor

Handles an incoming Pop3 connection. See rfc 1939, 1957, 2449 for details.

Author:
Eric Daugherty, Andreas Kyrmegalos (2.x branch)

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
Pop3Processor()
           
 
Method Summary
 boolean isUpdatingServerSocket()
           
 java.lang.String read()
          Reads a line from the input stream and returns it.
 void run()
          Entrypoint for the Thread, this method handles the interaction with the client socket.
 void setSocket(java.net.ServerSocket serverSocket)
          Sets the socket used to communicate with the client.
 void setUpdatingServerSocket(boolean value)
           
 void shutdown()
          Notifies this thread to stop processing and exit.
 void write(java.lang.String message, int errorIncrement)
          Writes the specified output message to the client.
 
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

Pop3Processor

public Pop3Processor()
Method Detail

setSocket

public void setSocket(java.net.ServerSocket serverSocket)
Sets the socket used to communicate with the client.

Specified by:
setSocket in interface ConnectionProcessor

isUpdatingServerSocket

public boolean isUpdatingServerSocket()

setUpdatingServerSocket

public void setUpdatingServerSocket(boolean value)
Specified by:
setUpdatingServerSocket in interface ConnectionProcessor

run

public void run()
Entrypoint for the Thread, this method handles the interaction with the client socket.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

shutdown

public void shutdown()
Notifies this thread to stop processing and exit.

Specified by:
shutdown in interface ConnectionProcessor

read

public java.lang.String read()
                      throws java.net.SocketException,
                             java.net.SocketTimeoutException,
                             java.io.IOException
Reads a line from the input stream and returns it.

Specified by:
read in interface ConnectionProcessor
Throws:
java.net.SocketException
java.net.SocketTimeoutException
java.io.IOException

write

public void write(java.lang.String message,
                  int errorIncrement)
           throws TooManyErrorsException,
                  java.io.IOException
Writes the specified output message to the client.

Specified by:
write in interface ConnectionProcessor
Throws:
TooManyErrorsException
java.io.IOException