|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jwall.web.audit.io.ConcurrentAuditWriter
public class ConcurrentAuditWriter
This class implements a simple writer that writes audit-events in the concurrent log format of modsecurity. It can be used with the AuditLogger tool to create concurrent audit-logs. It can also be used to convert serial auditlogs into the concurrent log format.
| Field Summary | |
|---|---|
static SimpleDateFormat |
DATE_FORMAT
|
static SimpleDateFormat |
DIR_FORMAT
|
| Constructor Summary | |
|---|---|
ConcurrentAuditWriter(File baseDir)
Create a new audit-writer that writes events into sub-directories below the given directory base according to their date. |
|
ConcurrentAuditWriter(File baseDir,
File indexFile)
This constructor creates a new instance of the class that writes all events to files within the given directory baseDir. |
|
| Method Summary | |
|---|---|
static String |
createSummary(AuditEvent evt)
This method creates a summary-string from the given audit-event. |
File |
getDirectoryFor(Date date)
This method creates the file-name for the given date and also creates the file itself and the corresponding subdirectories. |
File |
getFileFor(AuditEvent evt)
|
File |
write(AuditEvent evt)
This method writes the given audit-event evt to a file, whose name is
deducted from the creation time of the event. |
void |
writeEvent(AuditEvent evt)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final SimpleDateFormat DIR_FORMAT
public static final SimpleDateFormat DATE_FORMAT
| Constructor Detail |
|---|
public ConcurrentAuditWriter(File baseDir,
File indexFile)
throws IOException
baseDir. In addition to that, the
writer creates summary-entries in an index-file denoted by indexFile.
baseDir - The directory where to store the event-data files.indexFile - The file to which the index-entries are appended.
IOException - In case an IO-error occurs (file-permissions, etc.)
public ConcurrentAuditWriter(File baseDir)
throws IOException
base according to their date. The index-file is assumed to
be the file index within that directory.
baseDir - The base directory where the audit-data files are stored.
Exception - In case base is not a directory or cannot be created or
is not writable.
IOException| Method Detail |
|---|
public File write(AuditEvent evt)
throws IOException
evt to a file, whose name is
deducted from the creation time of the event. The file is created relative to the
base-directory given at construction-time of this writer-instance.
Additionally a summary-entry will be created that is appended to the index-file.
evt - The AuditEvent-instance to be written to disk.
IOException
public File getFileFor(AuditEvent evt)
throws IOException
IOException
public void writeEvent(AuditEvent evt)
throws IOException
writeEvent in interface AuditEventWriterIOException
public File getDirectoryFor(Date date)
throws IOException
date - The date of an event.
IOException - In case the file or any of the subdirectories cannot be created.public static String createSummary(AuditEvent evt)
evt - The event to create the summary from.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||