TPTP 4.0.0 Monitoring Tools Project
Public API Specification

org.eclipse.hyades.logging.parsers.importer
Interface ILogParser

All Known Implementing Classes:
ParserWrapper

public interface ILogParser

This is the interface that embodies a log file parser. The log records are parsed from the file and CommonBaseEvent objects are created to represent the data in the log records. This interface is used to extend the Log Import wizard of Log and Trace Analyzer to add custom parsers. Note: This interface is provisional. This is a new interface in TPTP v4.0 and may change in the next release. The expected flow of method calls by a user if this class would be:

    setUserInput();
    setParserLogger(); - optional
    parse(Log);
 
From another thread the following methods can be called:
    getStatus();
    stop();
 


Method Summary
 java.lang.String getStatus()
          This method is called by another thread to retrieve the status of the log file parsing.
 void parse(org.apache.commons.logging.Log argLogger)
          This method is called to perform the parsing of the log file and send the resulting CommonBaseEvent objects to an Apache Commons Log
 void setParserLogger(org.apache.commons.logging.Log parserLogger)
          Sets the logger that the parser can use to log its messages.
 void setUserInput(java.util.Hashtable table)
          This method is called to provide configuration information to the parser based on user input from the UI.
 void stop()
          This method is called by another thread to stop the parsing of the log file.
 

Method Detail

setUserInput

public void setUserInput(java.util.Hashtable table)
                  throws LogParserException
This method is called to provide configuration information to the parser based on user input from the UI. For example, it can be used to provide the name of the log file that is to be parsed. Configuation parameters are passed as a Hashtable of key/value pairs where the key is the parameter name and the value is the parameter value.

Parameters:
table - Hashtable containing keys and values of configuration information
Throws:
LogParserException - thrown if the specified configuration information is incorrect or invalid for the parser.

parse

public void parse(org.apache.commons.logging.Log argLogger)
           throws LogParserException
This method is called to perform the parsing of the log file and send the resulting CommonBaseEvent objects to an Apache Commons Log

Parameters:
argLogger - logger to which CommonBaseEvent objects are written
Throws:
LogParserException - thrown if exception is detected while executing function of this superclass

stop

public void stop()
This method is called by another thread to stop the parsing of the log file.


getStatus

public java.lang.String getStatus()
This method is called by another thread to retrieve the status of the log file parsing. The status is a String and can be an error message or the status of the parsing in the format:

"total=tttttt processed=pppppp"

where tttttt represents the total size of the log file and pppppp represents the size of data processed so far.

Returns:
String - status string

setParserLogger

public void setParserLogger(org.apache.commons.logging.Log parserLogger)
Sets the logger that the parser can use to log its messages.

Parameters:
parserLogger - The org.apache.commons.logging.Log logger that the parser will log its messages to.

TPTP 4.0.0 Monitoring Tools Project
Public API Specification