net.logAnalyzer.handlers
Class LAMessage

java.lang.Object
  extended bynet.logAnalyzer.handlers.LAMessage

public final class LAMessage
extends java.lang.Object

Instances of this class are used to contain a log messageLabel parsed from a log file.

Each messageLabel has references to converters in getConverters() used to parse/format messageLabel field values.

Version:
0.1
Author:
KKI

Constructor Summary
LAMessage(LALogHandler handler, java.lang.Object[] values)
          Constructs a messageLabel with the converters and values specified.
 
Method Summary
 void extendsMessage(java.lang.String unparsedLine)
          Adds an unparsed line to the value of the messageLabel column (converter '%m' for log4j but could be any converter with LAConverter.isMessage() returning true).
 LAConverter getConverter(int index)
          Returns the converter at the specified index.
 int getConverterIndex(java.lang.String literal)
          Returns the index of the converter associated to the literal.
 LAConverter[] getConverters()
          Returns the converters.
 java.lang.String getStringValue(int index)
          Returns the value to the specified index.
 java.lang.String getStringValue(java.lang.String literal)
          Returns the value for the specified key.
 java.lang.Object getValue(int index)
          Returns the value to the specified index.
 java.lang.Object getValue(java.lang.String literal)
          Returns the value to the specified column.
 java.lang.Object[] getValues()
          Returns the values.
 java.lang.String toString()
          Returns the String representation of a messageLabel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LAMessage

public LAMessage(LALogHandler handler,
                 java.lang.Object[] values)
Constructs a messageLabel with the converters and values specified.

Parameters:
handler - LALogHandler creating the messageLabel.
values - Values of the messageLabel.
Method Detail

extendsMessage

public void extendsMessage(java.lang.String unparsedLine)
Adds an unparsed line to the value of the messageLabel column (converter '%m' for log4j but could be any converter with LAConverter.isMessage() returning true).

Parameters:
unparsedLine - Unparsed line to add to the messageLabel column value.
See Also:
LALogHandler.getMessageConverter()

getConverter

public LAConverter getConverter(int index)
Returns the converter at the specified index.

Parameters:
index - Index of the converter.
Returns:
Converter at the specified index.

getConverters

public LAConverter[] getConverters()
Returns the converters.

Returns:
Converters.

getConverterIndex

public int getConverterIndex(java.lang.String literal)
                      throws UnknownOrLiteralConverterException
Returns the index of the converter associated to the literal.

Parameters:
literal - Literal of the converter.
Returns:
index.
Throws:
UnknownOrLiteralConverterException

getStringValue

public java.lang.String getStringValue(int index)
Returns the value to the specified index.

Parameters:
index - Index of the value.
Returns:
Value at the specified index.

getStringValue

public java.lang.String getStringValue(java.lang.String literal)
                                throws UnknownOrLiteralConverterException
Returns the value for the specified key.

Parameters:
literal - Converter key as literal.
Returns:
Value at the specified index.
Throws:
UnknownOrLiteralConverterException

getValue

public java.lang.Object getValue(int index)
Returns the value to the specified index.

Parameters:
index - Index of the value.
Returns:
Value at the specified index.

getValue

public java.lang.Object getValue(java.lang.String literal)
                          throws UnknownOrLiteralConverterException
Returns the value to the specified column.

Parameters:
literal - Literal of the column.
Returns:
Value for the specified column.
Throws:
UnknownOrLiteralConverterException - If the literal does not identify a non literal column.

getValues

public java.lang.Object[] getValues()
Returns the values.

Returns:
Values.

toString

public java.lang.String toString()
Returns the String representation of a messageLabel. Equals to the original messageLabel read from the log file (plus the computed column if any).

Returns:
String representation of the messageLabel.
See Also:
Object.toString()


Copyright © 2006 null. All Rights Reserved.