com.timeindexing.plugin
Class MailServerLogLine

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

public class MailServerLogLine
extends Line

A plugin that takes an input stream and returns a line at a time. The data is parsed as a Mail log file, and it expects to see dates of the following format: Mar 17 14:01:03 . Mail server logs do not put the year in the log file, so we need a mechanism to put one in. The solution chosen is to find out what this year is. It is possible to tell this plugin what the year is using the setYear() method.


Constructor Summary
MailServerLogLine(java.io.BufferedReader inReader)
          Construct a MailServerLogLine plugin from a BufferedReader.
MailServerLogLine(java.io.InputStream inStream)
          Construct a MailServerLogLine plugin from an InputStream.
MailServerLogLine(java.io.Reader inReader)
          Construct a MailServerLogLine plugin from a Reader.
 
Method Summary
protected  boolean eofProcess()
          Processing at EOF.
protected  ReaderPlugin init()
          Initialise the plugin
protected  ReaderResult process(java.lang.String line)
          Process the line
protected  MailServerLogLine setYear(int yr)
          Set the year to start from
 
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

MailServerLogLine

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


MailServerLogLine

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


MailServerLogLine

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

Method Detail

init

protected ReaderPlugin init()
Initialise the plugin


process

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

Overrides:
process in class Line

setYear

protected MailServerLogLine setYear(int yr)
Set the year to start from


eofProcess

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

Overrides:
eofProcess in class Line