public class NetworkAuditEventSource extends Thread implements AuditEventSource
Thread.State, Thread.UncaughtExceptionHandlerMAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Modifier | Constructor and Description |
|---|---|
protected |
NetworkAuditEventSource(Socket s)
This creates a simple tcp based connection using the given socket.
|
|
NetworkAuditEventSource(String host,
int port,
boolean ssl)
This creates a new instance of this class which connects to the given server
and port.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addEventListener(AuditEventListener l)
This method adds the given listener to the list of listeners to be notified
of new events.
|
void |
close()
This method tries to cleanly unregister from the server and close the tcp connection.
|
boolean |
connect(String login,
String pass)
This method is used to connect this client side source to an audit event server.
|
boolean |
hasNext()
This method returns true if there is at least one more event pending, so
if
hasNext returns true, the next call to nextEvent
should neither fail nor throw an exception. |
ModSecurityAuditEvent |
nextEvent()
Returns the next available AuditEvent.
|
void |
removeEventListener(AuditEventListener l)
This method removes the given listener.
|
void |
run() |
void |
setFilter(AuditEventFilter f)
This sets a filter on the source.
|
activeCount, checkAccess, clone, 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, yieldprotected NetworkAuditEventSource(Socket s) throws Exception
s - The socket representing the client end-point.Exception - In case no stream could be opened on the socket.public NetworkAuditEventSource(String host, int port, boolean ssl) throws Exception
ssl is true, the connection will be established
using SSL encryption.host - The server name to which to connect to.port - The port at which the event server is listening.ssl - If to connect using ssl.Exception - In case the connection could not be established.public void addEventListener(AuditEventListener l)
l - The listener to be added.public void removeEventListener(AuditEventListener l)
l - The listener to be removed.public boolean hasNext()
AuditEventSourcehasNext returns true, the next call to nextEvent
should neither fail nor throw an exception.hasNext in interface AuditEventSourcetrue iff there is another event available.AuditEventSource.hasNext()public ModSecurityAuditEvent nextEvent()
AuditEventSourcenull
is returned.nextEvent in interface AuditEventSourceAuditEventSource.nextEvent()public void setFilter(AuditEventFilter f)
AuditEventSourcenull.setFilter in interface AuditEventSourcef - The filter that determines the events which are returned.org.jwall.web.audit.io.AuditEventSource#setFilter(org.jwall.web.audit.AuditEventFilter)public boolean connect(String login, String pass) throws Exception
login - The user name used to authenticate.pass - The password for authentication.true, if the user was successfully authenticated.Exception - In case an IO error occurs.public void close()
Copyright © 2014 jwall.org. All Rights Reserved.