Package com.tailf.ncs.alarmman.producer
Class AlarmSink
Object
com.tailf.ncs.alarmman.producer.AlarmSink
The class
AlarmSink represents a "sink" where
Alarm objects are added in order to be written to the
alarm table.
The AlarmSinkrelieves the user of writing directly into
the alarm table.
An AlarmSink can be created in two ways: stand alone
or through AlarmSinkCentral.
- Stand alone
In this mode
AlarmSinkis created with aMaapiobject which is used when writing to the alarm list. - Through
AlarmSinkCentralIn this mode, writing is handled by a proxy before it is written to the alarm list. TheAlarmSinkis created with its default constructor and submitting is always done indirectly through theAlarmSinkCentralwhich is always started in an NCS JVM.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs anAlarmSink.Construct anAlarmSinkusing the givenMaapiobject for writing alarms directly to the alarm list.AlarmSink(AlarmSinkCentral central) Construct anAlarmSinkusing the givenAlarmSinkCentralobject for writing alarms indirectly to the alarm list. -
Method Summary
Modifier and TypeMethodDescriptionvoidsubmitAlarm(Alarm alarm) Submits the specifiedAlarminto the alarm list.booleansubmitAlarm(ManagedDevice managedDevice, ManagedObject managedObject, ConfIdentityRef alarmtype, ConfBuf specificProblem, PerceivedSeverity severity, ConfBuf alarmText, List<ManagedObject> impactedObjects, List<AlarmId> relatedAlarms, List<ManagedObject> rootCauseObjects, ConfDatetime timeStamp, Attribute... customAttributes) Submits the specifiedAlarminto the alarm list.booleansubmitAlarm(ManagedDevice managedDevice, ManagedObject managedObject, ConfIdentityRef alarmtype, ConfBuf specificProblem, PerceivedSeverity severity, String alarmText, List<ManagedObject> impactedObjects, List<AlarmId> relatedAlarms, List<ManagedObject> rootCauseObjects, ConfDatetime timeStamp, Attribute... customAttributes) Submits the specifiedAlarminto the alarm list.
-
Constructor Details
-
AlarmSink
public AlarmSink()Constructs anAlarmSink. This sink writes alarms to NCS indirectly using the thread local NcsMain instanceAlarmSinkCentralobject.Note: This constructor shall be the preferred constructor used if you are writing alarms inside the NCS JVM i.e in a package component.
-
AlarmSink
Construct anAlarmSinkusing the givenAlarmSinkCentralobject for writing alarms indirectly to the alarm list.The
AlarmSinkis standalone and does not use theAlarmSinkCentral.- Parameters:
central- object to be used for writing alarms
-
AlarmSink
Construct anAlarmSinkusing the givenMaapiobject for writing alarms directly to the alarm list.The
AlarmSinkis standalone and does not use theAlarmSinkCentral.- Parameters:
maapi- object to be used for writing alarms- Throws:
NavuException
-
-
Method Details
-
submitAlarm
Submits the specifiedAlarminto the alarm list. If the alarm's key "managedDevice, managedObject, alarmType, specificProblem" already exists, the existing alarm will be updated with a new status change entry.- Parameters:
alarm- The alarm to be written to the alarm list- Throws:
NavuExceptionConfExceptionIOException
-
submitAlarm
public boolean submitAlarm(ManagedDevice managedDevice, ManagedObject managedObject, ConfIdentityRef alarmtype, ConfBuf specificProblem, PerceivedSeverity severity, String alarmText, List<ManagedObject> impactedObjects, List<AlarmId> relatedAlarms, List<ManagedObject> rootCauseObjects, ConfDatetime timeStamp, Attribute... customAttributes) throws NavuException, ConfException, IOException Submits the specifiedAlarminto the alarm list. If the alarm's key "managedDevice, managedObject, alarmType, specificProblem" already exists, the existing alarm will be updated with a new status change entry. Alarm identity:- Parameters:
managedDevice- the managed device which emits the alarm.managedObject- the managed object emitting the alarm.alarmtype- the alarm type of the alarm.specificProblem- is used when the alarmtype cannot uniquely identify the alarm type. Normally, this is not the case, and this leaf is the empty string. Status change within the alarm:severity- the severity of the alarm.alarmText- the alarm textimpactedObjects- Objects that might be affected by this alarmrelatedAlarms- Alarms related to this alarmrootCauseObjects- Objects that are candidates for causing the alarm.timeStamp- The time the status of the alarm changed, as reported by the devicecustomAttributes- Custom attributes- Returns:
- boolean true/false wheather the submitting the specified alarm was successful
- Throws:
IOExceptionConfExceptionNavuException
-
submitAlarm
public boolean submitAlarm(ManagedDevice managedDevice, ManagedObject managedObject, ConfIdentityRef alarmtype, ConfBuf specificProblem, PerceivedSeverity severity, ConfBuf alarmText, List<ManagedObject> impactedObjects, List<AlarmId> relatedAlarms, List<ManagedObject> rootCauseObjects, ConfDatetime timeStamp, Attribute... customAttributes) throws NavuException, ConfException, IOException Submits the specifiedAlarminto the alarm list. If the alarms key "managedDevice, managedObject, alarmType, specificProblem" already exists, the existing alarm will be updated with a new status change entry. Alarm identity:- Parameters:
managedDevice- the managed device which emits the alarm.managedObject- the managed object emitting the alarm.alarmtype- the alarm type of the alarm.specificProblem- is used when the alarmtype cannot uniquely identify the alarm type. Normally, this is not the case, and this leaf is the empty string. Status change within the alarm:severity- the severity of the alarm.alarmText- the alarm textimpactedObjects- Objects that might be affected by this alarmrelatedAlarms- Alarms related to this alarmrootCauseObjects- Objects that are candidates for causing the alarm.timeStamp- The time the status of the alarm changed, as reported by the devicecustomAttributes- Custom attributes- Returns:
- boolean true/false wheather the submitting the specified alarm was successful
- Throws:
IOExceptionConfExceptionNavuException
-