|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Thread
org.jwall.web.audit.io.AuditLogFileWriter
public class AuditLogFileWriter
This is a persistence-thread which listens for events and writes them to a file. Writing to a file can also be configured to create a file for each set of events grouped together by the value of the Host-header field.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.lang.Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
static String |
VERSION
|
| Fields inherited from class java.lang.Thread |
|---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
|---|---|
AuditLogFileWriter(File dir,
boolean hostBased,
int logLevel)
|
|
AuditLogFileWriter(File dir,
int logLevel,
String groupBy)
This constructor creates a new instance of this class which writes events to several files grouped by a request-property that is given by groupBy. |
|
| Method Summary | |
|---|---|
void |
add(AuditEvent evt)
|
void |
add(Collection<AuditEvent> evts)
|
void |
addAlias(String alias,
String server)
This method lets you specify an alias for a webserver so that events having this alias in their Host:-header will
be written to the same file as the ones with the server-name in
the Host-header. |
void |
addEventListener(AuditEventListener listener)
|
void |
addEvents(Collection<AuditEvent> events)
|
void |
close()
|
void |
eventArrived(AuditEvent evt)
this will block if the queue is full ! |
void |
eventsArrived(Collection<AuditEvent> events)
This method is called for notifying the listener of arrival of several events in a block. |
int |
eventsPending()
|
String[] |
getColumnNames()
|
String |
getFile()
|
double[] |
getStatistics()
Returns the number of events written since the last call of this method. |
boolean |
hasEventsPending()
|
int |
left()
|
int |
length()
|
void |
run()
|
void |
setSteadyWriter(boolean b)
A writer not being steady just writes it queue on disk and exits. |
void |
writeEvent(AuditEvent evt)
|
| 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 |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String VERSION
| Constructor Detail |
|---|
public AuditLogFileWriter(File dir,
int logLevel,
String groupBy)
groupBy.
dir - The basic directory where the files are created.logLevel - A log-level for debugging.groupBy - The name of the property by which events should by grouped.
public AuditLogFileWriter(File dir,
boolean hostBased,
int logLevel)
| Method Detail |
|---|
public void run()
run in interface Runnablerun in class Thread
public void writeEvent(AuditEvent evt)
throws IOException
writeEvent in interface AuditEventWriterIOExceptionpublic void eventArrived(AuditEvent evt)
eventArrived in interface EventListener<AuditEvent>eventArrived in interface AuditEventListenerevt - The event which arrived.public void add(AuditEvent evt)
public void add(Collection<AuditEvent> evts)
public void addEventListener(AuditEventListener listener)
public double[] getStatistics()
public String[] getColumnNames()
public String getFile()
public void addAlias(String alias,
String server)
Host:-header will
be written to the same file as the ones with the server-name in
the Host-header.
alias - server - public boolean hasEventsPending()
public int eventsPending()
public void eventsArrived(Collection<AuditEvent> events)
AuditEventListenerAuditEventListener.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.
eventsArrived in interface AuditEventListenerevents - The block of events arrived.public void addEvents(Collection<AuditEvent> events)
public int length()
public int left()
public void setSteadyWriter(boolean b)
b - public void close()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||