org.jwall.web.audit.net
Class NetworkClientWorkerThread

java.lang.Object
  extended by java.lang.Thread
      extended by org.jwall.web.audit.net.NetworkClientWorkerThread
All Implemented Interfaces:
Runnable, EventListener<AuditEvent>, AuditEventListener

public class NetworkClientWorkerThread
extends Thread
implements AuditEventListener

This class implements a client handler thread. There will be one of these threads for each client.

Author:
Christian Bockermann <chris@jwall.org>

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
static int MAX_LOGIN_FAILURES
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
NetworkClientWorkerThread(Socket sock, Authenticator users, NetworkEventServer serv)
           
 
Method Summary
 void checkCommand()
           
 void eventArrived(AuditEvent evt)
          This method is called when a new event arrives at the listener.
 void eventsArrived(Collection<AuditEvent> events)
          This method is called for notifying the listener of arrival of several events in a block.
 boolean isClosed()
           
 void run()
           
 String toString()
           
 
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, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_LOGIN_FAILURES

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

NetworkClientWorkerThread

public NetworkClientWorkerThread(Socket sock,
                                 Authenticator users,
                                 NetworkEventServer serv)
                          throws Exception
Throws:
Exception
Method Detail

run

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

eventArrived

public void eventArrived(AuditEvent evt)
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 #notify(), thus a listener might wait for packets to arrive.

Specified by:
eventArrived in interface EventListener<AuditEvent>
Specified by:
eventArrived in interface AuditEventListener
Parameters:
evt - The event which arrived.

eventsArrived

public void eventsArrived(Collection<AuditEvent> events)
Description copied from interface: AuditEventListener
This method is called for notifying the listener of arrival of several events in a block. Usually, this method is implemented by calling AuditEventListener.eventArrived(AuditEvent) for each of the given events, but may be handled in a more efficient way by implementations capable of processing blocks of events.

Specified by:
eventsArrived in interface AuditEventListener
Parameters:
events - The block of events arrived.

isClosed

public boolean isClosed()

toString

public String toString()
Overrides:
toString in class Thread

checkCommand

public void checkCommand()


Copyright © 2012 jwall.org. All Rights Reserved.