com.timeindexing.plugin
Class WebServerLogLine

java.lang.Object
  extended bycom.timeindexing.plugin.DefaultReader
      extended bycom.timeindexing.plugin.Line
          extended bycom.timeindexing.plugin.WebServerLogLine
All Implemented Interfaces:
ReaderPlugin

public class WebServerLogLine
extends Line

A plugin that takes an input stream and returns a line at a time. The data is parsed as a Web log file, and it expects to see dates of the following format: [01/Jul/2003:10:15:05 +0100] .


Constructor Summary
WebServerLogLine(java.io.BufferedReader inReader)
          Construct a WebServerLogLine plugin from a BufferedReader.
WebServerLogLine(java.io.InputStream inStream)
          Construct a WebServerLogLine plugin from an InputStream.
WebServerLogLine(java.io.Reader inReader)
          Construct a WebServerLogLine plugin from a Reader.
 
Method Summary
 java.util.Date bespokeParse(java.lang.String aDate)
          Provide a bespoke parser for dates which look like [08/Jul/2001:07:03:39 +0000]
protected  boolean eofProcess()
          Processing at EOF.
protected  ReaderPlugin init()
          Initialise the plugin
protected  void initMonthMap()
           
 int monthIndex(java.lang.String monthString, int offset)
           
protected  ReaderResult process(java.lang.String line)
          Process the line
 
Methods inherited from class com.timeindexing.plugin.Line
read
 
Methods inherited from class com.timeindexing.plugin.DefaultReader
getInputStream, isEOF, setEOF, setInputStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.timeindexing.plugin.ReaderPlugin
getInputStream, isEOF, setEOF, setInputStream
 

Constructor Detail

WebServerLogLine

public WebServerLogLine(java.io.InputStream inStream)
Construct a WebServerLogLine plugin from an InputStream.


WebServerLogLine

public WebServerLogLine(java.io.Reader inReader)
Construct a WebServerLogLine plugin from a Reader.


WebServerLogLine

public WebServerLogLine(java.io.BufferedReader inReader)
Construct a WebServerLogLine plugin from a BufferedReader.

Method Detail

init

protected ReaderPlugin init()
Initialise the plugin


initMonthMap

protected void initMonthMap()

process

protected ReaderResult process(java.lang.String line)
Process the line

Overrides:
process in class Line

bespokeParse

public java.util.Date bespokeParse(java.lang.String aDate)
                            throws java.text.ParseException
Provide a bespoke parser for dates which look like [08/Jul/2001:07:03:39 +0000]

Throws:
java.text.ParseException

monthIndex

public int monthIndex(java.lang.String monthString,
                      int offset)
               throws java.text.ParseException
Throws:
java.text.ParseException

eofProcess

protected boolean eofProcess()
Processing at EOF. Return values states if something happended.

Overrides:
eofProcess in class Line