See: Description
Interface | Description |
---|---|
AlarmSinkCentralMBean |
This is the JMX interface for the AlarmSinkCentral class
|
Class | Description |
---|---|
AlarmSink |
The class
AlarmSink represents a "sink" where
Alarm objects are added in order to be written to the
alarm table. |
AlarmSinkCentral |
An
AlarmSinkCentral represent a central "proxy"
for created AlarmSink 's. |
The Alarm Manager producer package provides support for injection of alarms into the NCS Alarm list.
Example 1: Injection of alarm directlyExample 2: Injection of alarm through AlarmSinkCental which is started when NCS JVM is started// If this is not running inside the NCS JVM, // a maapi socket is needed in order to write the alarms. Socket socket = new Socket("127.0.0.1", Conf.NCS_PORT); Maapi maapi = new Maapi(socket); maapi.startUserSession("system", InetAddress.getByName("localhost"), "system", new String[] {}, MaapiUserSessionFlag.PROTO_TCP); AlarmSink sink = new AlarmSink(maapi); ArrayList<AlarmId> idList = new ArrayList<AlarmId>(); AlarmId a1 = new AlarmId(new ManagedDevice("device0"), new ConfIdentityRef(new NcsAlarms().hash(), NcsAlarms._ncs_dev_manager_alarm), new ManagedObject("/ncs:devices/device[name=device0]" + "/config/root1")); AlarmId a2 = new AlarmId(new ManagedDevice("device0"), new ConfIdentityRef(new NcsAlarms().hash(), NcsAlarms._ncs_dev_manager_alarm), new ManagedObject("/ncs:devices/device[name=device0]" + "/config/root2")); idList.add(a1); idList.add(a2); sink.submitAlarm(new ManagedDevice("device0"), new ManagedObject("/ncs:devices/device[name=device0]" + "/config/root3"), new ConfIdentityRef(new NcsAlarms().hash(), NcsAlarms._ncs_dev_manager_alarm), new ConfBuf("My specific problem"), PerceivedSeverity.WARNING, new ConfBuf("This is a warning"), null, idList, null, ConfDatetime.getConfDatetime(), new AlarmAttribute(new myAlarm(), myAlarm._custom_alarm_attribute_, new ConfBuf("an alarm attribute")), new StatusChangeAttribute(new myAlarm(), myAlarm._custom_change_attribute_, new ConfBuf("a change")));
AlarmSink sink = new AlarmSink(); ArrayList<AlarmId> idList = new ArrayList<AlarmId>(); AlarmId a1 = new AlarmId(new ManagedDevice("device0"), new ConfIdentityRef(new NcsAlarms().hash(), NcsAlarms._ncs_dev_manager_alarm), new ManagedObject("/ncs:devices/device[name=device0]" + "/config/root1")); AlarmId a2 = new AlarmId(new ManagedDevice("device0"), new ConfIdentityRef(new NcsAlarms().hash(), NcsAlarms._ncs_dev_manager_alarm), new ManagedObject("/ncs:devices/device[name=device0]" + "/config/root2")); idList.add(a1); idList.add(a2); sink.submitAlarm(new ManagedDevice("device0"), new ManagedObject("/ncs:devices/device[name=device0]" + "/config/root3"), new ConfIdentityRef(new NcsAlarms().hash(), NcsAlarms._ncs_dev_manager_alarm), new ConfBuf("My specific problem"), PerceivedSeverity.WARNING, new ConfBuf("This is a warning"), null, idList, null, ConfDatetime.getConfDatetime(), new AlarmAttribute(new myAlarm(), myAlarm._custom_alarm_attribute_, new ConfBuf("an alarm attribute")), new StatusChangeAttribute(new myAlarm(), myAlarm._custom_change_attribute_, new ConfBuf("a change")));