Package com.tailf.ncs.alarmman.consumer


package com.tailf.ncs.alarmman.consumer

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();
 }
 
  • Class
    Description
    This class establishes a listener queue for emitted alarms.
    The consuming part of the Alarm API.
    This is the JMX interface for the AlarmSourceCentral class