iCMS.masterd
Class MasterHandler

java.lang.Object
  extended by java.lang.Thread
      extended by luky.serverSimple.Handler
          extended by iCMS.masterd.MasterHandler
All Implemented Interfaces:
Runnable

public class MasterHandler
extends Handler

The Master Handler handles iCMS clients

Version:
2.0.1
Author:
Chris Lukassen
 

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
protected  MasterServer myParent
           
 
Fields inherited from class luky.serverSimple.Handler
in, out, parent, propsMan
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MasterHandler(Hashtable userData, Server parent, BufferedReader in, PrintWriter out, PropertyManager propsMan, String caller)
           
 
Method Summary
 int destroy(BufferedReader in, PrintWriter out)
           
 int handleUserCommand(BufferedReader in, PrintWriter out, String command)
          Handles user commands VALID COMMANDS:
HELLO, SHUTDOWN, CLOSE, CLEAN, HELP,
--- buildt in commands
HISTORY,
--- returns the trap history
TRAPON, TRAPOFF,
--- switches trap passing on/off
DESCR [token],
--- returns the descripiton of this token
INFO [token],
--- returns the info fields of this token
PROBE [token]/[Informational],<
--- probes this info field
AVAIL,
--- lists all available tokens
STATUS [token],
--- returns the status of this token
SUB [token],
--- subs the client to this token
ACTION [token],
--- returns the actions possible on this token
START, STOP, [token]
--- starts or stops a token
CONNECT,
--- connects a client equal to STATUS ALL, HISTORY, SUB ALL, TRAP ON,
--- DESCR [all tokens], INFO [all tokens], ACTION [all tokens]
 void myEventOccurred(MyEvent evt)
           
 int stateChangeOccured(String token, String newState)
           
 int trapOccured(String trap)
           
 boolean trapOn()
           
 
Methods inherited from class luky.serverSimple.Handler
decrypt, run
 
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

myParent

protected MasterServer myParent
Constructor Detail

MasterHandler

public MasterHandler(Hashtable userData,
                     Server parent,
                     BufferedReader in,
                     PrintWriter out,
                     PropertyManager propsMan,
                     String caller)
Method Detail

handleUserCommand

public int handleUserCommand(BufferedReader in,
                             PrintWriter out,
                             String command)
Handles user commands

VALID COMMANDS:
HELLO, SHUTDOWN, CLOSE, CLEAN, HELP,
--- buildt in commands
HISTORY,
--- returns the trap history
TRAPON, TRAPOFF,
--- switches trap passing on/off
DESCR [token],
--- returns the descripiton of this token
INFO [token],
--- returns the info fields of this token
PROBE [token]/[Informational],<
--- probes this info field
AVAIL,
--- lists all available tokens
STATUS [token],
--- returns the status of this token
SUB [token],
--- subs the client to this token
ACTION [token],
--- returns the actions possible on this token
START, STOP, [token]
--- starts or stops a token
CONNECT,
--- connects a client equal to STATUS ALL, HISTORY, SUB ALL, TRAP ON,
--- DESCR [all tokens], INFO [all tokens], ACTION [all tokens]

Overrides:
handleUserCommand in class Handler

trapOn

public boolean trapOn()

stateChangeOccured

public int stateChangeOccured(String token,
                              String newState)

trapOccured

public int trapOccured(String trap)

myEventOccurred

public void myEventOccurred(MyEvent evt)

destroy

public int destroy(BufferedReader in,
                   PrintWriter out)
Overrides:
destroy in class Handler