alma::acs::logging::engine::parser::ACSLogParserVTD Class Reference

Inheritance diagram for alma::acs::logging::engine::parser::ACSLogParserVTD:
Inheritance graph
[legend]
Collaboration diagram for alma::acs::logging::engine::parser::ACSLogParserVTD:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ACSLogParserVTD () throws Exception
synchronized ILogEntry parse (String xmlString) throws LogParseException

Private Member Functions

void initReflection () throws Exception
Vector< AdditionalDatagetAdditionalData (Object vNav, ByteArrayOutputStream os, byte[] bytesArray) throws Exception
String getString (Object vtdNav, ByteArrayOutputStream os, String attrName, byte[] bytesXML) throws Exception
Integer getInteger (Object vtdNav, ByteArrayOutputStream os, String attrName, byte[] bytesXML) throws Exception
Long getLongFromTimestamp (Object vtdNav, ByteArrayOutputStream os, String attrName, byte[] bytesXML) throws LogParseException, Exception
LogTypeHelper determineEntryType (Object vtdNav) throws Exception
LogEntry makeLogEntryFromParsedXML (byte[] bytesArray, String xmlString) throws LogParseException
String getLogMessage (Object vn) throws Exception

Private Attributes

Object vtdGen = null
Method VTDGen_clear = null
Method VTDGen_setDoc = null
Method VTDGen_parse = null
Method VTDGen_getNav = null
int NAV_ROOT
int NAV_FIRST_CHILD
int NAV_NEXT_SIBLING
Method VTDNav_toElement = null
Method VTDNav_toElement_String = null
Method VTDNav_matchElement = null
Method VTDNav_hasAttr = null
Method VTDNav_toString = null
Method VTDNav_getText = null
Method VTDNav_getAttrVal = null
Method VTDNav_getAttrCount = null
Method VTDNav_getTokenOffset = null
Method VTDNav_getTokenCount = null
Method VTDNav_getTokenLength = null
Method VTDNav_toNormalizedString = null

Static Private Attributes

static final Object[] nullObj = new Object[0]

Detailed Description

ACSLogParserVTD uses the VTD XML parser to parse XML logs. VTD is used for performance reasons. For more information on VTD, see their web site.

Author:
sharring
See also:
http://vtd-xml.sourceforge.net/
ACSLogParser

Constructor & Destructor Documentation

alma::acs::logging::engine::parser::ACSLogParserVTD::ACSLogParserVTD (  )  throws Exception [inline]

Constructor.

References initReflection().


Member Function Documentation

LogTypeHelper alma::acs::logging::engine::parser::ACSLogParserVTD::determineEntryType ( Object  vtdNav  )  throws Exception [inline, private]

Returns the entry type as an Integer for the current log that is being parsed.

Parameters:
vn an instance of a VTDNav object to use in ascertaining the entry type of the log that is being parsed.
Returns:
a LogTypeHelper denoting the type of entry (e.g. INFO, DEBUG, WARNING, etc.)
null if the entry does not match with any log type
Exceptions:
NavException if the VTDNav navigation fails for some reason.
See also:
LogTypeHelper
Vector<AdditionalData> alma::acs::logging::engine::parser::ACSLogParserVTD::getAdditionalData ( Object  vNav,
ByteArrayOutputStream  os,
byte[]  bytesArray 
) throws Exception [inline, private]

Gets a Vector<AdditionalData> from VTD XML parser (using VTDNav navigation)

Parameters:
vtdNav the navigator to use to navigate the parsed xml
os output stream to use for conversion of bytes to useful formatted data.
bytesXML the bytes (containing XML) that are being referenced by the navigator.
Returns:
Vector<AdditionalData> populated with the additional data for the log message, if any, else null
Exceptions:
NavException if navigation encounters problems

References NAV_FIRST_CHILD, and VTDNav_toElement_String.

Integer alma::acs::logging::engine::parser::ACSLogParserVTD::getInteger ( Object  vtdNav,
ByteArrayOutputStream  os,
String  attrName,
byte[]  bytesXML 
) throws Exception [inline, private]

Gets an Integer from VTD XML parser (using VTDNav navigation)

Parameters:
vtdNav the navigator to use to navigate the parsed xml
os output stream to use for conversion of bytes to useful formatted data.
attrName the name of the field we are searching for
bytesXML the bytes (containing XML) that are being referenced by the navigator.
Returns:
Integer populated with the attribute's value
Exceptions:
NavException if navigation encounters problems
String alma::acs::logging::engine::parser::ACSLogParserVTD::getLogMessage ( Object  vn  )  throws Exception [inline, private]

Get the body of a log.

The log message must be read with this method because of the mixed content

Parameters:
vn The VTDNav
Returns:
The message of the log
Exceptions:
Exception 
Long alma::acs::logging::engine::parser::ACSLogParserVTD::getLongFromTimestamp ( Object  vtdNav,
ByteArrayOutputStream  os,
String  attrName,
byte[]  bytesXML 
) throws LogParseException, Exception [inline, private]

Gets a Long from VTD XML parser (using VTDNav navigation)

Parameters:
vtdNav the navigator to use to navigate the parsed xml
os output stream to use for conversion of bytes to useful formatted data.
attrName the name of the field we are searching for
bytesXML the bytes (containing XML) that are being referenced by the navigator.
Returns:
Long populated with the attribute's value
Exceptions:
NavException if navigation encounters problems
LogParseException if parsing fails
String alma::acs::logging::engine::parser::ACSLogParserVTD::getString ( Object  vtdNav,
ByteArrayOutputStream  os,
String  attrName,
byte[]  bytesXML 
) throws Exception [inline, private]

Gets a String from VTD XML parser (using VTDNav navigation)

Parameters:
vtdNav the navigator to use to navigate the parsed xml
os output stream to use for conversion of bytes to useful formatted data.
attrName the name of the field we are searching for
bytesXML the bytes (containing XML) that are being referenced by the navigator.
Returns:
String populated with the attribute's value
Exceptions:
NavException if navigation encounters problems
void alma::acs::logging::engine::parser::ACSLogParserVTD::initReflection (  )  throws Exception [inline, private]
LogEntry alma::acs::logging::engine::parser::ACSLogParserVTD::makeLogEntryFromParsedXML ( byte[]  bytesArray,
String  xmlString 
) throws LogParseException [inline, private]

Creates a LogEntry from raw XML, using a VTD XML parser.

Parameters:
xmlString the XML string that is being parsed.
bytesArray the array of bytes (also containing the xml string that we are parsing, in byte form) to be used by VTD.
vtdGen the instance of VTDGen to use for parsing the XML
Returns:
A LogEntry populated with the data for the log entry contained in the XML string passed in.
Exceptions:
LogParseException if the parsing fails
synchronized ILogEntry alma::acs::logging::engine::parser::ACSLogParserVTD::parse ( String  xmlString  )  throws LogParseException [inline, virtual]

Implements required method of ACSLogParser interface.

Parameters:
xmlString the XML string to parse
Exceptions:
LogParseException when problems are encountered parsing an XML message.
See also:
ACSLogParser

Implements alma::acs::logging::engine::parser::ACSLogParser.


Member Data Documentation

GETNav.FIRST_CHILD

Referenced by getAdditionalData(), and initReflection().

GETNav.NEXT_SIBLING

Referenced by initReflection().

GETNav.ROOT

Referenced by initReflection().

final Object [] alma::acs::logging::engine::parser::ACSLogParserVTD::nullObj = new Object[0] [static, private]

Support field to pass null while reflection invokes methods having no params

private instance of VTDGen used for parsing XML

Referenced by initReflection().

VTDGen.clear();

Referenced by initReflection().

VTDGen.getNav();

Referenced by initReflection().

VTDGen.parse(boolean);

Referenced by initReflection().

VTDGen.setDoc(byte[]);

Referenced by initReflection().

VTDNav.getAttrCount();

Referenced by initReflection().

VTDNav.getAttrVal(String);

Referenced by initReflection().

VTDNav.getText();

Referenced by initReflection().

VTDNav.getTokenCount();

Referenced by initReflection().

VTDNav.getTokenLength(int);

Referenced by initReflection().

VTDNav.getTokenOffset(int);

Referenced by initReflection().

VTDNav.hasAttr(String)

Referenced by initReflection().

VTDNav.matchElement(String)

Referenced by initReflection().

VTDNav.toElement(int)

Referenced by initReflection().

VTDNav.toElement(int,String)

Referenced by getAdditionalData(), and initReflection().

VTDNav.toNormalizedStringgetTokenLength(int);

Referenced by initReflection().

VTDNav.toString(int)

Referenced by initReflection().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2