Defining alarm states with the API

Alarms carried by telecom objects are described in the same way as states. Alarms are held by one of the IltObjectState object attributes and are modeled using an instance of the class IltAlarm.State, which is a subclass of IltState. The alarm state object includes the following information:
  • For each alarm severity:
    • The number of new alarms of this severity
    • The number of acknowledged alarms of this severity
  • Boolean indicators for special conditions:
    • Not Reporting: the equipment has ceased reporting alarms.
    • Loss of Connectivity: the connection with the equipment has been lost, thus making the recorded number of alarms unreliable.
The alarm model is the same for most of the existing object state classes. When the alarm information is based on the alarm model, you can retrieve this information by calling the method IltObject.getAlarmState.

How to set alarm counters

The API for managing alarms is directly available from the IltObject class.
The following code line retrieves the object state corresponding to the alarms for an object named paris .
IltAlarm.State alarms = paris.getAlarmState();
The following code line shows how to set the count of new alarms to the object.
alarms.setNewAlarmCount(IltAlarm.Severity.Critical, 2);
To set the count of acknowledged alarms, use the following code:
alarms.setAcknowledgedAlarmCount(IltAlarm.Severity.Critical, 2);
Alarms can be set either directly, as shown above, or incrementally, as in the following code where a new critical alarm is added to the same network element.

How to set alarms incrementally

alarms.addNewAlarm(IltAlarm.Severity.Critical);
System.out.println("Critical alarms on Paris: "
         + alarms.getNewAlarmCount(IltAlarm.Severity.Critical));
The printed output is the following:
Critical alarms on Paris: 3 new

How to set special alarm statuses

Special alarm statuses are set and unset using dedicated APIs.
To switch to the loss-of-connectivity mode, use the following:
alarms.setLossOfConnectivity(true);
To switch to the not-reporting mode, use the following:
alarms.setNotReporting(true);