void step6() throws Exception{
mainDataSource.parse("updates.xml");
elements.xml
. The object to be updated is identified by its identifier.
Then, the attribute to be updated is identified and the new
values are given.
<updateObject id="BTS11"> <attribute name="objectState" javaClass="ilog.tgo.model.IltOSIObjectState"> <state> <administrative>ShuttingDown</administrative> <operational>Enabled</operational> <usage>Active</usage> </state> <alarms> <new severity="Warning">4</new> </alarms> <procedural>Reporting</procedural> <repair>UnderRepair</repair> <performance state="Output">150</performance> </attribute> </updateObject>
BTS11
object.
IltObject london = (IltObject)mainDataSource.getObject("London");
london
is to be updated and is retrieved from the data source.
IltOSI.State osiState = new IltOSI.State(IltOSI.State.Operational.Enabled, IltOSI.State.Usage.Idle, IltOSI.State.Administrative.Locked);
Enabled
,
Idle
, and
Locked
of specific OSI states are created for this object through
inner classes of IltOSI.State. The value
Enabled
is attributed to IltOSI.State.Operational. The value
Idle
is attributed to IltOSI.State.Usage. The value
Locked
is attributed to IltOSI.State.Administrative
objectState
, for this object with the primary state
osiState
.
IltOSIObjectState objectState = new IltOSIObjectState(osiState);
IltAlarm.State alarmState = (IltAlarm.State)objectState.getAlarmState(); alarmState.addNewAlarm(IltAlarm.Severity.Minor); alarmState.addAcknowledgedAlarm(IltAlarm.Severity.Critical);
objectState
using the method getAlarmState. addNewAlarm allows you to add an
unacknowledged alarm with the severity
Minor
.
Critical
.
london.setObjectState(objectState); }
objectState
with its possible alarms to the object
london
. The data source and its attached graphic components are
automatically notified of this change.