org.jwall.web.audit.net
Class NetworkEventServer

java.lang.Object
  extended by java.lang.Thread
      extended by org.jwall.web.audit.net.NetworkEventServer
All Implemented Interfaces:
java.lang.Runnable, AuditEventListener

public class NetworkEventServer
extends java.lang.Thread
implements AuditEventListener

This class implements a small event-server thread. It will listen on a socket and wait for a NetworkAuditEventSource to connect and push all events to the connected event-sources. This class is not well-tested!

Author:
Christian Bockermann

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
static int CLIENT_POLL_TIME
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
NetworkEventServer(int port, java.util.Properties auth)
           
NetworkEventServer(java.lang.String serv, int port, java.util.Properties auth)
           
NetworkEventServer(java.lang.String s, java.util.Properties auth)
           
 
Method Summary
static NetworkEventServer createSSLEventServer(java.io.File keyFile, java.lang.String pass, int port, java.util.Properties auth)
           
static NetworkEventServer createSSLEventServer(java.io.InputStream keyIn, int port, java.util.Properties auth)
           
static NetworkEventServer createSSLEventServer(java.io.InputStream keyStream, java.lang.String pass, int port, java.util.Properties auth)
           
 void eventArrived(AuditEvent e)
          This method is called when a new event arrives at the listener.
 void run()
           
 void unregisterClient(NetworkClientWorkerThread t)
           
 
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

CLIENT_POLL_TIME

public static final int CLIENT_POLL_TIME
See Also:
Constant Field Values
Constructor Detail

NetworkEventServer

public NetworkEventServer(java.lang.String s,
                          java.util.Properties auth)
                   throws java.lang.Exception
Throws:
java.lang.Exception

NetworkEventServer

public NetworkEventServer(java.lang.String serv,
                          int port,
                          java.util.Properties auth)
                   throws java.lang.Exception
Throws:
java.lang.Exception

NetworkEventServer

public NetworkEventServer(int port,
                          java.util.Properties auth)
                   throws java.lang.Exception
Throws:
java.lang.Exception
Method Detail

createSSLEventServer

public static NetworkEventServer createSSLEventServer(java.io.File keyFile,
                                                      java.lang.String pass,
                                                      int port,
                                                      java.util.Properties auth)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

createSSLEventServer

public static NetworkEventServer createSSLEventServer(java.io.InputStream keyIn,
                                                      int port,
                                                      java.util.Properties auth)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

createSSLEventServer

public static NetworkEventServer createSSLEventServer(java.io.InputStream keyStream,
                                                      java.lang.String pass,
                                                      int port,
                                                      java.util.Properties auth)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

run

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

eventArrived

public void eventArrived(AuditEvent e)
Description copied from interface: AuditEventListener
This method is called when a new event arrives at the listener. The Listener should be threaded and response-time to this method should be as small as possible. After the dispatcher calls this method each listener gets a call to notiy(), thus a listener might wait for packets to arrive.

Specified by:
eventArrived in interface AuditEventListener

unregisterClient

public void unregisterClient(NetworkClientWorkerThread t)