Public Member Functions | Public Attributes | Protected Attributes

alma.acs.logging.tools.LogConverter Class Reference

Inheritance diagram for alma.acs.logging.tools.LogConverter:
alma.acs.logging.tools.CSVConverter alma.acs.logging.tools.XMLConverter alma.acs.logging.tools.TextConverter alma.acs.logging.tools.TwikiTableConverter

List of all members.

Public Member Functions

 LogConverter ()
 LogConverter (String cols)
 LogConverter (Collection< LogField > fields, boolean additionlData)
void setCols (String columns)
void setCols (Collection< LogField > columns, boolean additionlData)
abstract String convert (ILogEntry log)
abstract String getHeader ()

Public Attributes

final char ADDITIONAL_DATA_ID = 'j'

Protected Attributes

String colIndex

Detailed Description

The base class of the converters of the logs.

It is possible:

Note that the format of the XML is not customizable i.e. the selected columns and their order will be ignored while converting.

Author:
acaproni
Since:
ACS 8.1.0

Constructor & Destructor Documentation

alma.acs.logging.tools.LogConverter.LogConverter (  ) 

Default constructor: the converted string will contain all the fields.

References alma.acs.logging.tools.LogConverter.setCols().

alma.acs.logging.tools.LogConverter.LogConverter ( String  cols  ) 

Constructor

Parameters:
cols A string describing the columns and their position in the converted String

References alma.acs.logging.tools.LogConverter.setCols().

alma.acs.logging.tools.LogConverter.LogConverter ( Collection< LogField >  fields,
boolean  additionlData 
)

Constructor

This constructor only allows to have additional data appened at the end of the other fields.

Parameters:
fields A collection describing the columns and their position in the converted String
additionlData true if the additional data must be appended in the last position of the converted string

References alma.acs.logging.tools.LogConverter.setCols().


Member Function Documentation

abstract String alma.acs.logging.tools.LogConverter.convert ( ILogEntry  log  )  [pure virtual]

Convert the log to a string of the given format

Parameters:
log The log to convert to a String
Returns:
An ASCII string with the selected format

Implemented in alma.acs.logging.tools.CSVConverter, alma.acs.logging.tools.TwikiTableConverter, and alma.acs.logging.tools.XMLConverter.

Referenced by alma.acs.logging.tools.LogFileSplitter.logEntryReceived(), and alma.acs.logging.tools.LogFileExtractor.logEntryReceived().

abstract String alma.acs.logging.tools.LogConverter.getHeader (  )  [pure virtual]

Generate the header for the given converter.

If no header is needed, the heder return an empty string.

Returns:

Implemented in alma.acs.logging.tools.CSVConverter, alma.acs.logging.tools.TwikiTableConverter, and alma.acs.logging.tools.XMLConverter.

void alma.acs.logging.tools.LogConverter.setCols ( String  columns  ) 

Set the columns to write in the converted string.

Parameters:
columns A string of columns; if null or empty then colIndexs contain all the fields plus the additional data
See also:
colIndex

References alma.acs.logging.tools.LogConverter.ADDITIONAL_DATA_ID, and alma.acs.logging.tools.LogConverter.colIndex.

Referenced by alma.acs.logging.tools.LogConverter.LogConverter(), and alma.acs.logging.tools.LogConverter.setCols().

void alma.acs.logging.tools.LogConverter.setCols ( Collection< LogField >  columns,
boolean  additionlData 
)

Set the columns to write in the converted string

Parameters:
columns A vector of LogField representing the field to write in the converted string
additionlData true if the additional data must be appended in the last position of the converted string
See also:
colIndexVector

References alma.acs.logging.tools.LogConverter.ADDITIONAL_DATA_ID, and alma.acs.logging.tools.LogConverter.setCols().


Member Data Documentation

Additional data is not a field of the log so its value is specified here as a constant char

Referenced by alma.acs.logging.tools.LogConverter.setCols().

The string representing the columns and their order.

colIndex is composed of chars identifying the column and their position. Each char is is a LogField.id or ADDITIONAL_DATA_ID.

For example if colIndex=="0f1j" then the converted string contains entries with like that: timestamp, message, log type, addData 1, addData2...addDataN because LogField.TIMESTAMP.id=0, LogFiled.LOGMESSAGE=f, LogField.ENTRYTYPE.id=1 and ADDITIONAL_DATA_ID=j.

Note that this is ignored while converting to XML!

See also:
LogField
LogConverter.colIndexVector

Referenced by alma.acs.logging.tools.CSVConverter.convert(), alma.acs.logging.tools.CSVConverter.getHeader(), and alma.acs.logging.tools.LogConverter.setCols().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties