

Public Member Functions | |
| LogEntryXML (String stackId, int stackLevel) throws DOMException | |
| LogEntryXML (Random random) | |
| LogEntryXML (Node log) throws DOMException | |
| boolean | hasDatas () |
| NodeList | getDatas () |
| Node | getNode () |
| String | getEntryTypeAsString () |
| Object | getField (LogField f) |
| LogTypeHelper | getType () |
| boolean | isLogEntryMessageSimple () |
| String | toString () |
| String | toXMLString () |
| Vector< AdditionalData > | getAdditionalData () |
| void | addData (String name, String value) |
Static Public Member Functions | |
| static LogEntryXML | generateRandomLog (Random random) |
| static final boolean | isValidLogEntryType (int index) |
| static void | printNode (Node logNode, int depth) |
Public Attributes | |
| VectorNodeList | complexLogEntryMessage = null |
Protected Member Functions | |
| void | setField (LogField field, Object value) |
Private Member Functions | |
| void | initAttributes (Node log) throws DOMException |
| void | initBody (Node log) throws DOMException |
| void | initialize (Node log) throws DOMException |
| void | initLogEntryType (Node log) throws DOMException |
| StringBuffer | getXMLDatas () |
Private Attributes | |
| VectorNodeList | datas = null |
| final Object[] | fields = new Object[LogField.values().length] |
| Node | log = null |
| boolean | isLogEntrySimple = true |
| SimpleDateFormat | dateFormat = new IsoDateFormat() |
This is the container class for generic Log Entries. Attributes, messages and Data(s) are obtained via public variables. Properties, used for management of LogEntries can be obtained via accessor and mutator methods. This class is used when parsing nodes. The class is used when a file is read or a node is received by the push consumer.
Note on reuse of equal Strings, Integers etc: The XML parser currently produces separate instances of the same Strings, so that a lot of memory would be used up unnecessarily. This class reuses String objects for its field values, but does not exchange the String instances that are referenced by the log Node. That current design will only yield a memory advantage if the LogEntryXML instance is not kept permanently in the application, but instead its fields are read and the values transfered (without the DOM Node) to an object of another class. Ale: please check if there are other Srings that could be reused based on stringPool, and if we should use also a pool for Integers, at least for log levels since they are always the same few.
| com::cosylab::logging::engine::log::LogEntryXML::LogEntryXML | ( | String | stackId, | |
| int | stackLevel | |||
| ) | throws DOMException [inline] |
References setField().
Referenced by generateRandomLog().
| com::cosylab::logging::engine::log::LogEntryXML::LogEntryXML | ( | Random | random | ) | [inline] |
This costructor is used only for testing purposes. It is called by com.cosylab.logging.engine.simulator.simulatorRemoteAccess It generates a random LogEntryXML
References setField().
| com::cosylab::logging::engine::log::LogEntryXML::LogEntryXML | ( | Node | log | ) | throws DOMException [inline] |
This constructor is called by the DOMParser.
| log | org.w3c.Node |
References initialize(), and log.
| void com::cosylab::logging::engine::log::LogEntryXML::addData | ( | String | name, | |
| String | value | |||
| ) | [inline] |
Add a data node to this log: <Data name="name">value</Data>
| name | The name, i.e. the key of the pair | |
| value | The value of the field |
Implements com::cosylab::logging::engine::log::ILogEntry.
| static LogEntryXML com::cosylab::logging::engine::log::LogEntryXML::generateRandomLog | ( | Random | random | ) | [inline, static] |
References LogEntryXML().
| Vector<AdditionalData> com::cosylab::logging::engine::log::LogEntryXML::getAdditionalData | ( | ) | [inline] |
The vector return contains only strings and it is formed in this way: name value name value name value... i.e. it is a plain representation of couples of values
Implements com::cosylab::logging::engine::log::ILogEntry.
References datas, and com::cosylab::logging::engine::VectorNodeList::item().
Referenced by getXMLDatas(), and com::cosylab::logging::engine::log::LogEntry::LogEntry().
| NodeList com::cosylab::logging::engine::log::LogEntryXML::getDatas | ( | ) | [inline] |
Data Nodes are returned as a org.w3c.dom.NodeList. If data(s) are not present, null is returned.
References datas.
| String com::cosylab::logging::engine::log::LogEntryXML::getEntryTypeAsString | ( | ) | [inline] |
Returns the type of this Object as String. "Undeclared" id type is not specified.
Referenced by com::cosylab::logging::LogEntryTest::testLogEntry1(), toString(), and toXMLString().
| Object com::cosylab::logging::engine::log::LogEntryXML::getField | ( | LogField | f | ) | [inline] |
Returns a specific field according to field name constants. Creation date: (11/21/2001 18:16:03)
| fieldIndex | int index of the field to return |
Implements com::cosylab::logging::engine::log::ILogEntry.
References fields.
Referenced by getType(), initAttributes(), initLogEntryType(), com::cosylab::logging::engine::log::LogEntry::LogEntry(), toString(), and toXMLString().
| Node com::cosylab::logging::engine::log::LogEntryXML::getNode | ( | ) | [inline] |
References log.
| LogTypeHelper com::cosylab::logging::engine::log::LogEntryXML::getType | ( | ) | [inline] |
Implements com::cosylab::logging::engine::log::ILogEntry.
References getField().
Referenced by toXMLString().
| StringBuffer com::cosylab::logging::engine::log::LogEntryXML::getXMLDatas | ( | ) | [inline, private] |
References datas, and getAdditionalData().
Referenced by toXMLString().
| boolean com::cosylab::logging::engine::log::LogEntryXML::hasDatas | ( | ) | [inline] |
Check if the log entry has datas
Implements com::cosylab::logging::engine::log::ILogEntry.
References datas.
| void com::cosylab::logging::engine::log::LogEntryXML::initAttributes | ( | Node | log | ) | throws DOMException [inline, private] |
References dateFormat, getField(), log, and setField().
Referenced by initialize().
| void com::cosylab::logging::engine::log::LogEntryXML::initBody | ( | Node | log | ) | throws DOMException [inline, private] |
References complexLogEntryMessage, datas, isLogEntrySimple, log, and setField().
Referenced by initialize().
| void com::cosylab::logging::engine::log::LogEntryXML::initialize | ( | Node | log | ) | throws DOMException [inline, private] |
References initAttributes(), initBody(), initLogEntryType(), and log.
Referenced by LogEntryXML().
| void com::cosylab::logging::engine::log::LogEntryXML::initLogEntryType | ( | Node | log | ) | throws DOMException [inline, private] |
References getField(), log, and setField().
Referenced by initialize().
| boolean com::cosylab::logging::engine::log::LogEntryXML::isLogEntryMessageSimple | ( | ) | [inline] |
This boolean tag specifies whether LogEntryMessage is simple or not:
logEntryMessageSimple = true: Log message is a single String. It is obtained via String logEntry.simpleLogEntryMessage. Value is null if message is not present. logEntryMessageSimple = false: Log message is more complex, it is an XML org.w3c.dom.NodeList. It is obtained via org.w3c.dom.NodeList logEntry.complexLogEntryMessage. Value is null if message is simple. | static final boolean com::cosylab::logging::engine::log::LogEntryXML::isValidLogEntryType | ( | int | index | ) | [inline, static] |
Insert the method's description here. Creation date: (12/4/2001 12:21:35)
| index | int |
| static void com::cosylab::logging::engine::log::LogEntryXML::printNode | ( | Node | logNode, | |
| int | depth | |||
| ) | [inline, static] |
Recursively prints the struct of the node
| logNode | The node to print |
| void com::cosylab::logging::engine::log::LogEntryXML::setField | ( | LogField | field, | |
| Object | value | |||
| ) | [inline, protected] |
Sets the specified field. This method is protected since the fields are not to be modified. The only time this is called is during initialization. Creation date: (11/21/2001 18:35:10)
| field | The field | |
| value | java.lang.Object value to set |
References fields.
Referenced by initAttributes(), initBody(), initLogEntryType(), and LogEntryXML().
| String com::cosylab::logging::engine::log::LogEntryXML::toString | ( | ) | [inline] |
Returns a String representation of the log.
Implements com::cosylab::logging::engine::log::ILogEntry.
References datas, getEntryTypeAsString(), and getField().
| String com::cosylab::logging::engine::log::LogEntryXML::toXMLString | ( | ) | [inline] |
Return the object as XML string
Implements com::cosylab::logging::engine::log::ILogEntry.
References dateFormat, getEntryTypeAsString(), getField(), getType(), getXMLDatas(), and log.
Referenced by initBody().
VectorNodeList com::cosylab::logging::engine::log::LogEntryXML::datas = null [private] |
Referenced by addData(), getAdditionalData(), getDatas(), getXMLDatas(), hasDatas(), initBody(), and toString().
SimpleDateFormat com::cosylab::logging::engine::log::LogEntryXML::dateFormat = new IsoDateFormat() [private] |
Referenced by initAttributes(), and toXMLString().
final Object [] com::cosylab::logging::engine::log::LogEntryXML::fields = new Object[LogField.values().length] [private] |
Referenced by getField(), and setField().
boolean com::cosylab::logging::engine::log::LogEntryXML::isLogEntrySimple = true [private] |
Referenced by initBody().
Node com::cosylab::logging::engine::log::LogEntryXML::log = null [private] |
Referenced by addData(), getNode(), initAttributes(), initBody(), initialize(), initLogEntryType(), LogEntryXML(), and toXMLString().
1.6.2