net.logAnalyzer.handlers
Class ForwardOnlyLogHandler

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

public class ForwardOnlyLogHandler
extends AbstractLogHandler

This log handler does not save messages. It is useful for analyzers but can not be used for GUI because it only can to go forward and does not support backward or random access to the log file.

For random access, for example for a GUI, use MemoryLogHandler for small log files and OnDemandLogHandler for large files.

Version:
0.1
Author:
Karim REFEYTON

Constructor Summary
ForwardOnlyLogHandler(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 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, releaseParsing, removeLogHandlerListener, run, setAnalyzers, setMaxRecords
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForwardOnlyLogHandler

public ForwardOnlyLogHandler(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()


Copyright © 2006 null. All Rights Reserved.