org.jwall.web.audit.io
Class ModSecurity2AuditReader

java.lang.Object
  extended by org.jwall.web.audit.io.AbstractAuditEventReader
      extended by org.jwall.web.audit.io.ModSecurity2AuditReader
All Implemented Interfaces:
Iterable<AuditEvent>, AuditEventReader

public class ModSecurity2AuditReader
extends AbstractAuditEventReader
implements AuditEventReader

This class implements a parser for audit-logfile for the modsecurity2. It also implements the AuditEventSource interface.

Author:
Christian Bockermann <chris@jwall.org>

Field Summary
 
Fields inherited from class org.jwall.web.audit.io.AbstractAuditEventReader
DEFAULT_AUDIT_EVENT_FACTORY_CLASS
 
Constructor Summary
ModSecurity2AuditReader(File file)
          This simple constructor creates a reader which will simply read events from the given file without listening for newly appended events.
ModSecurity2AuditReader(File file, boolean tail)
          This constructor creates a ModSecurity2-AuditReader with a file as source.
ModSecurity2AuditReader(InputStream in)
          This constructor creates an audit-event-Reader that reads from the given input stream.
ModSecurity2AuditReader(InputStream in, boolean persist)
          This constructor creates an audit-event-Reader that reads from the given input stream.
ModSecurity2AuditReader(Reader inputReader)
           
 
Method Summary
 Iterator<AuditEvent> iterator()
           
 AuditEvent readNext()
          This method tries to read the next event that is available.
 
Methods inherited from class org.jwall.web.audit.io.AbstractAuditEventReader
atEOF, bytesAvailable, bytesRead, close, getDataRead, getFileSize, getSectionIndex, hasNext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jwall.web.audit.io.AuditEventReader
atEOF, bytesAvailable, bytesRead, close
 

Constructor Detail

ModSecurity2AuditReader

public ModSecurity2AuditReader(InputStream in)
                        throws IOException
This constructor creates an audit-event-Reader that reads from the given input stream.

Parameters:
in - The stream to read from.
Throws:
IOException - In case the stream cannot be opened or another IO error occurs.

ModSecurity2AuditReader

public ModSecurity2AuditReader(InputStream in,
                               boolean persist)
                        throws IOException
This constructor creates an audit-event-Reader that reads from the given input stream.

Parameters:
in - The stream to read from.
Throws:
IOException - In case the stream cannot be opened or another IO error occurs.

ModSecurity2AuditReader

public ModSecurity2AuditReader(File file,
                               boolean tail)
                        throws IOException
This constructor creates a ModSecurity2-AuditReader with a file as source.

Parameters:
file - The file to read from.
tail - Skip the whole file at first and read only events that are subsequently appended.
Throws:
IOException - In case an IO error occurs.

ModSecurity2AuditReader

public ModSecurity2AuditReader(File file)
                        throws IOException
This simple constructor creates a reader which will simply read events from the given file without listening for newly appended events.

Parameters:
file - The file to read events from.
Throws:
IOException - In case an IO error occurs.
Exception - In case of a parsing error.

ModSecurity2AuditReader

public ModSecurity2AuditReader(Reader inputReader)
                        throws IOException
Throws:
IOException
Method Detail

readNext

public AuditEvent readNext()
                    throws IOException,
                           ParseException
Description copied from interface: AuditEventReader
This method tries to read the next event that is available.

Specified by:
readNext in interface AuditEventReader
Specified by:
readNext in class AbstractAuditEventReader
Returns:
The next audit-event from or NULL if no event is available.
Throws:
IOException
ParseException
See Also:
AuditEventReader.readNext()

iterator

public Iterator<AuditEvent> iterator()
Specified by:
iterator in interface Iterable<AuditEvent>


Copyright © 2012 jwall.org. All Rights Reserved.