iCMS.masterd
Class MasterServer

java.lang.Object
  extended by java.lang.Thread
      extended by luky.serverSimple.Server
          extended by iCMS.masterd.MasterServer
All Implemented Interfaces:
Runnable, EventListener, MyEventListener

public class MasterServer
extends Server

The Master Server handles iCMS clients

Version:
2.0.6
Author:
Chris Lukassen
 

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
Fields inherited from class luky.serverSimple.Server
listenerList, myHandlers, propsMan, userData, version
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
MasterServer(boolean log, int logLevel, PropertyManager props, boolean quiet)
           
 
Method Summary
 SortVector getMonitoredItemsTokens()
          returns the monitored items tokens
 String getStatus(String token)
          returns the status of this token
 Vector getTrapHistory()
          returns the last 100 (defineable) traps received by the server
protected  Handler makeNewHandler(Hashtable userData, BufferedReader in, PrintWriter out, PropertyManager propsMan, String caller)
          creates a new handler to talk to a client
 void myEventOccurred(MyEvent evt)
          triggered by the clients on traps or state changes
 void requestAllStatuses()
           
 void runCommand(String command, String token, PrintWriter out)
          runs command on the appropriate client
can only handle one request at the time, possible perfomance problem
 
Methods inherited from class luky.serverSimple.Server
addMyEventListener, childEventOccurred, fireMyEvent, getPropsMan, print, println, removeHandler, removeMyEventListener, run, setQuit, userInit
 
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

MasterServer

public MasterServer(boolean log,
                    int logLevel,
                    PropertyManager props,
                    boolean quiet)
Method Detail

requestAllStatuses

public void requestAllStatuses()

runCommand

public void runCommand(String command,
                       String token,
                       PrintWriter out)
runs command on the appropriate client
can only handle one request at the time, possible perfomance problem


getMonitoredItemsTokens

public SortVector getMonitoredItemsTokens()
returns the monitored items tokens


getStatus

public String getStatus(String token)
returns the status of this token


getTrapHistory

public Vector getTrapHistory()
returns the last 100 (defineable) traps received by the server


myEventOccurred

public void myEventOccurred(MyEvent evt)
triggered by the clients on traps or state changes

Specified by:
myEventOccurred in interface MyEventListener
Overrides:
myEventOccurred in class Server

makeNewHandler

protected Handler makeNewHandler(Hashtable userData,
                                 BufferedReader in,
                                 PrintWriter out,
                                 PropertyManager propsMan,
                                 String caller)
creates a new handler to talk to a client

Overrides:
makeNewHandler in class Server