Loading an alarm defined in XML
All you have to do is create a data source using the data source default implementation defined by
IltDefaultDataSource and pass the XML file to be read to its
parse method, as follows:
dataSource = new IltDefaultDataSource();
dataSource.parse("AlarmXMLFile.xml");
For detailed information about data sources, see section
Data sources.
How to define an alarm in XML
The following is an example of an alarm defined in XML format. For details about the XML elements used in this example, see table
Elements in an XML data file .
In this example, the first alarm object ( alarm 1 ) is an acknowledged raw alarm with a perceived severity level of Warning, and affecting the managed object Router1. The second alarm object ( alarm 2 ) is a unacknowledged impact alarm with a perceived severity level of MajorHigh, and affecting the managed object Gateway1.
<cplData>
<addObject id="alarm 1">
<class>ilog.tgo.model.IltAlarm</class>
<attribute name="notificationId">alarm 1</attribute>
<attribute name="alarmAckState">true</attribute>
<attribute name="ackSystemId">leipzig</attribute>
<attribute name="ackUserId">leibniz</attribute>
<attribute name="ackTime">Mon, 05 Jan 2004 13:33:25 GMT+0430</attribute>
<attribute name="alarmRaisedTime">Mon, 05 Jan 2004 13:30:12 GMT+0430</
attribute>
<attribute name="managedObjectInstance"
javaClass="java.lang.String">Router1</attribute>
<attribute name="alarmType"></attribute>
<attribute name="perceivedSeverity">Raw.Warning</attribute>
<attribute name="probableCause">0</attribute>
</addObject>
<addObject id="alarm 2">
<class>ilog.tgo.model.IltAlarm</class>
<attribute name="notificationId">alarm 2</attribute>
<attribute name="alarmAckState">false</attribute>
<attribute name="alarmRaisedTime">Mon, 05 Jan 2004 13:54:52 GMT+0430</
attribute>
<attribute name="managedObjectInstance"
javaClass="java.lang.String">Gateway1</attribute>
<attribute name="perceivedSeverity">Impact.MajorHigh</attribute>
<attribute name="probableCause">303</attribute>
</addObject>
</cplData>
The following figure shows the two alarms displayed in a table component:
Alarms Displayed in a Table Component
The attribute
managedObjectInstance may be of any Java™ class. To benefit from the automatic consolidation of alarm states from individual alarms, use the same value as the object identifier of the corresponding managed object. See
Setting the alarm counters.
To set a value in XML, specify the Java class of the value. For well-known classes, use:
<attribute name="comments" javaClass="java.lang.String">comment</attribute>.
For other specific classes, the XML format will be the same but the classes must conform to the JViews TGO type converter constraints.
For details about the well-known classes and the type converter, refer to
Type converter in the
Context and Deployment Descriptordocumentation.
Copyright © 2018, Rogue Wave Software, Inc. All Rights Reserved.