org.lateralnz.common.telnet
Class BaseHandler

java.lang.Object
  extended by java.lang.Thread
      extended by org.lateralnz.common.telnet.BaseHandler
All Implemented Interfaces:
java.lang.Runnable, Constants
Direct Known Subclasses:
ConsoleInterface

public class BaseHandler
extends java.lang.Thread
implements Constants


Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  java.io.InputStream in
           
protected  java.lang.StringBuffer line
           
protected  java.io.OutputStream out
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface org.lateralnz.common.telnet.Constants
AO, AYT, BACKSPACE, BRK, CARRIAGE_RETURN, DM, DO, DONT, EC, ECHO, EL, ENVIRONMENT_VARS, ESC_DOWN, ESC_LEFT, ESC_RIGHT, ESC_UP, ESCAPE, GA, IAC, IP, LINEFEED, LINEMODE, NOP, NULL, REMOTE_FLOW_CONTROL, SB, SE, STATUS, SUPPRESS_GO_AHEAD, TERMINAL_SPEED, TERMINAL_TYPE, TIMING_MARK, WILL, WINDOW_SIZE, WONT
 
Constructor Summary
BaseHandler(Server parent, java.net.Socket sock)
           
 
Method Summary
protected  boolean deleteChar()
           
 boolean handleControlChar(int c)
           
 boolean handleEscape(int esc, int mod)
           
 boolean handleInput(java.lang.String line)
           
 void run()
           
protected  void sendCursor(int count, int dir)
           
 void setEcho(boolean echo)
           
 void write(int[] bytes)
           
 
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
 

Field Detail

in

protected java.io.InputStream in

out

protected java.io.OutputStream out

line

protected java.lang.StringBuffer line
Constructor Detail

BaseHandler

public BaseHandler(Server parent,
                   java.net.Socket sock)
            throws java.io.IOException
Throws:
java.io.IOException
Method Detail

deleteChar

protected boolean deleteChar()
                      throws java.io.IOException
Throws:
java.io.IOException

sendCursor

protected void sendCursor(int count,
                          int dir)
                   throws java.io.IOException
Throws:
java.io.IOException

setEcho

public void setEcho(boolean echo)

write

public void write(int[] bytes)
           throws java.io.IOException
Throws:
java.io.IOException

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

handleControlChar

public boolean handleControlChar(int c)
                          throws java.io.IOException
Throws:
java.io.IOException

handleEscape

public boolean handleEscape(int esc,
                            int mod)
                     throws java.io.IOException
Throws:
java.io.IOException

handleInput

public boolean handleInput(java.lang.String line)
                    throws java.io.IOException
Throws:
java.io.IOException