net.vattp.tunnel
Class HTTPConnectionHandler

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--net.vattp.tunnel.HTTPConnectionHandler
All Implemented Interfaces:
Runnable

public class HTTPConnectionHandler
extends Thread

Untamed: Class to handle the suspension and shutdown messages.

Author:
Bill Frantz

Field Summary
private static char[] CRLF
           
private static String lenHead
           
private  HTTPInputStream myIn
           
private  ByteArrayOutputStream myOut
           
private  Hashtable mySessions
          map of sessions to logged on clients.
private  Socket mySocket
           
private  String myTcpListenAddress
           
private  Hashtable myVats
          map of logged on clients.
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
(package private) HTTPConnectionHandler(Socket socket, Hashtable vats, Hashtable sessions, String listenAddress)
           
 
Method Summary
private  void clientError(String msg)
           
private  void doLogon(DataInputStream in)
           
private  void doSession(DataInputStream in)
           
private  void flushInput()
           
private  void returnResponse(byte[] response)
           
 void run()
          Enabled:
private  void sendHTTPError(String msg, byte[] sessionID)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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
 

Field Detail

CRLF

private static final char[] CRLF

lenHead

private static final String lenHead

myVats

private final Hashtable myVats
map of logged on clients. Key is vatID, data is HTTPClient. Note that an entry in this map implies an entry in the sessions map and vicea versa.


mySessions

private final Hashtable mySessions
map of sessions to logged on clients. Key is sessionID, data is HTTPClient. Note that an entry in this map implies an entry in the vats map and vicea versa.


mySocket

private final Socket mySocket

myIn

private HTTPInputStream myIn

myOut

private final ByteArrayOutputStream myOut

myTcpListenAddress

private final String myTcpListenAddress
Constructor Detail

HTTPConnectionHandler

HTTPConnectionHandler(Socket socket,
                      Hashtable vats,
                      Hashtable sessions,
                      String listenAddress)
Method Detail

clientError

private void clientError(String msg)

doLogon

private void doLogon(DataInputStream in)
              throws IOException
IOException

doSession

private void doSession(DataInputStream in)
                throws IOException
IOException

flushInput

private void flushInput()

returnResponse

private void returnResponse(byte[] response)

run

public void run()
Enabled:

Specified by:
run in interface Runnable
Overrides:
run in class Thread
See Also:
java.lang.Thread#start(), java.lang.Thread#stop(), java.lang.Thread#Thread(java.lang.ThreadGroup, java.lang.Runnable, java.lang.String), java.lang.Runnable#run()

sendHTTPError

private void sendHTTPError(String msg,
                           byte[] sessionID)


comments?