net.logAnalyzer.handlers
Class OnDemandLogHandler

java.lang.Object
  extended bynet.logAnalyzer.handlers.AbstractLogHandler
      extended bynet.logAnalyzer.handlers.OnDemandLogHandler
All Implemented Interfaces:
LALogHandler, java.lang.Runnable

public class OnDemandLogHandler
extends AbstractLogHandler

This log handler parses messages on demand. It must be used to handle large log files with small memory needs.

Version:
0.1
Author:
Karim REFEYTON

Constructor Summary
OnDemandLogHandler(FilesSetReader input, java.lang.String pattern)
           
 
Method Summary
 int getSize()
          Returns the number of messages read.
protected  void initParsing()
          Modification to the inherited behavior.
protected  LAMessage loadMessage(int index)
          Modification to the inherited behavior.
protected  void releaseParsing()
          Returns to the start of the files set.
protected  void saveMessage(LAMessage message, long pointer)
          Modification to the inherited behavior.
 
Methods inherited from class net.logAnalyzer.handlers.AbstractLogHandler
addLogHandlerListener, fireEndParsing, fireStartParsing, fireStepParsing, getAnalyzers, getConverter, getConverter, getConverterIndex, getConverters, getFileLength, getFilePointer, getLastException, getMaxRecords, getMessage, getMessageConverter, getMessages, getPercentDone, getReader, isParsing, parse, parseMessage, readNextLine, removeLogHandlerListener, run, setAnalyzers, setMaxRecords
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnDemandLogHandler

public OnDemandLogHandler(FilesSetReader input,
                          java.lang.String pattern)
                   throws java.io.FileNotFoundException,
                          NoConverterException
Parameters:
input -
pattern -
Throws:
java.io.FileNotFoundException
NoConverterException
Method Detail

getSize

public int getSize()
Returns the number of messages read.

Specified by:
getSize in interface LALogHandler
Specified by:
getSize in class AbstractLogHandler
Returns:
physical number of messages.
See Also:
LALogHandler.getSize()

loadMessage

protected LAMessage loadMessage(int index)
Modification to the inherited behavior.

Specified by:
loadMessage in class AbstractLogHandler
Parameters:
index - Index of the messageLabel to load.
Returns:
Message.
See Also:
AbstractLogHandler.loadMessage(int)

saveMessage

protected void saveMessage(LAMessage message,
                           long pointer)
Modification to the inherited behavior.

Specified by:
saveMessage in class AbstractLogHandler
Parameters:
message - Parsed messageLabel.
pointer - File pointer to the start of the messageLabel.
See Also:
AbstractLogHandler.saveMessage(LAMessage, long)

initParsing

protected void initParsing()
                    throws java.io.IOException
Modification to the inherited behavior.

Overrides:
initParsing in class AbstractLogHandler
Throws:
java.io.IOException - If an error occures.
See Also:
AbstractLogHandler.initParsing()

releaseParsing

protected void releaseParsing()
                       throws java.io.IOException
Returns to the start of the files set.

Overrides:
releaseParsing in class AbstractLogHandler
Throws:
java.io.IOException - If an error occures.
See Also:
AbstractLogHandler.releaseParsing()


Copyright © 2006 null. All Rights Reserved.