com.ericdaugherty.mail.server.services.general
Class StreamHandler

java.lang.Object
  extended by com.ericdaugherty.mail.server.services.general.StreamHandler

public class StreamHandler
extends java.lang.Object

Each smtp/pop3 session hands control of its streams and socket to an instance of this class.

Author:
Andreas Kyrmegalos

Constructor Summary
StreamHandler()
           
 
Method Summary
 java.io.InputStream getActiveInputStream()
           
 java.io.OutputStream getActiveOutputStream()
           
 void print(java.lang.String line)
           
 int read()
           
 int read(byte[] output, int offset, int length)
           
 java.lang.String readLine()
           
 void setSaslServer(javax.security.sasl.SaslServer saslServer)
           
 void setSecureStreams(java.net.Socket socket)
           
 void setStreams(java.net.Socket socket)
           
 void write(byte[] line)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamHandler

public StreamHandler()
Method Detail

setStreams

public void setStreams(java.net.Socket socket)
                throws java.io.IOException
Throws:
java.io.IOException

getActiveOutputStream

public java.io.OutputStream getActiveOutputStream()

getActiveInputStream

public java.io.InputStream getActiveInputStream()

setSecureStreams

public void setSecureStreams(java.net.Socket socket)
                      throws java.io.IOException
Throws:
java.io.IOException

setSaslServer

public void setSaslServer(javax.security.sasl.SaslServer saslServer)
                   throws java.io.IOException
Throws:
java.io.IOException

read

public int read()
         throws java.io.IOException
Throws:
java.io.IOException

read

public int read(byte[] output,
                int offset,
                int length)
         throws java.io.IOException
Throws:
java.io.IOException

readLine

public java.lang.String readLine()
                          throws java.io.IOException
Throws:
java.io.IOException

print

public void print(java.lang.String line)
           throws java.io.IOException
Throws:
java.io.IOException

write

public void write(byte[] line)
           throws java.io.IOException
Throws:
java.io.IOException