Skip navigation links

Package com.tailf.ncs.alarmman.consumer

The Alarm Manager consumer package provides support for subscription to alarms in the NCS Alarm list.

See: Description

Package com.tailf.ncs.alarmman.consumer Description

The Alarm Manager consumer package provides support for subscription to alarms in the NCS Alarm list.

Example: Subscription to alarms
 // Set up a CDB socket
 Socket socket = new Socket(NcsMain.getInstance().getNcsHost(),
                            NcsMain.getInstance().getNcsPort());

 Cdb cdb = new Cdb("my-alarm-source-socket", socket);

 // Get and start alarm source - this must only be done once per JVM
 AlarmSourceCentral asc = AlarmSourceCentral.getAlarmSource(100000, cdb);
 asc.start();

 AlarmSource source = new AlarmSource();

 // Collect subscribed alarms.
 Alarm alarm = source.takeAlarm();

 while (alarm != null) {
     System.out.println(alarm);
     for (Attribute attr: alarm.getCustomAttributes()) {
         System.out.println(attr);
     }

     alarm = source.takeAlarm();
 }
 
Skip navigation links