public class Alarm extends Object
This class is used to represent an alarm instance of an entry in
/al:alarms/alarm-list/alarm
list.
New alarm objects can be created and submitted to NCS using the
AlarmSink.submitAlarm(Alarm)
methods.
Instances of this class could also be returned from
AlarmSource.pollAlarm(int,TimeUnit)
,
AlarmSource.takeAlarm()
.
When submitting a new alarm to NCS, NCS matches the new alarm against the existing Alarms in the alarm list. If the new Alarm matches an entry in the alarm list, that entry is simply updated with the new information provided. The full history of alarms submitted for the same event is kept and can be inspected through the NCS interfaces.
Therefore it is a desired pattern to submit alarms, even though it already exist in NCS.
A unique Alarm
instance is the combination of the following:
Managed Device
- ManagedDevice
This is the device on which the alarm started. It may have come as an event
from the device, or through detection on the manager side. The YANG type
is a string.
Managed Object
- ManagedObject
This is a reference to the 'alarming object' that
caused the alarm to be raised. In YANG it can be an instance-identifier, an
object-identifier or a string.
Alarm type
- ConfIdentityRef
The Alarm type is a YANG identityref. I.e. a reference to a YANG identity.
These are extensible and defined in the YANG files.
It is recommended to have very specific types as possible, and if it is
not possible, use also Specific Problem. The motivation is that as far as
possible avoid surprises for the operator with alarms that are not defined
beforehand.
Specific Problem
- ConfBuf
This is used when the 'Alarm type' cannot uniquely identify the problem.
It is recommended to specify the alarm in a presentable text for the user
here.
The Managed Device
, Managed object
Alarm Type
and Specific Problem
constitutes a AlarmId
.
There are other various information that an alarm has.
Perceived Severity
- PerceivedSeverity
This is the typical classification of how severe the problem is from
the device's or objects point of view.
Impacted Objects
- ManagedObject
In NCS it is possible to correlate the ManagedObject that caused the alarm
with ManagedObjects in Services using the alarming object. These are called
Impacted Objects. It is up to the implementor to decide if impacted objects
shall be used and how deep they should dig in the structure to claim
relations.
From NCS 2.3 a "Backpointer" attribute is available on objects that have been
set by services. This can be used here to determine Impacted Objects.
Related Alarms
- AlarmId
Other alarms caused by this alarm, or with some other relation to this alarm
can be listed here. The YANG Alarm model uses "device", "type", and
"managed-object" as indexing keys for alarms. Thus AlarmId contains these and
provide a reference to the YANG list entry.
Root cause objects
- ManagedObject
Objects that are candidates for raising the alarm. This is different from
the "Managed Object" parameter which only indicates the object that raised
the alarm. If the raising object is in a service, it may have raised the
alarm based on the fact that interface eth0 on device c0 had to high
packet loss. 'eth0' on 'c0' should then be presented in this list of
possible candidates.
The instance of this class is usually submitted in the
AlarmSink.submitAlarm(Alarm)
method to store the alarm representation in NCS.
It is also the returned from:
Constructor and Description |
---|
Alarm(ManagedDevice managedDevice,
ManagedObject managedObject,
ConfIdentityRef alarmType,
ConfBuf specificProblem,
PerceivedSeverity severity,
boolean isCleared,
String alarmText,
List<ManagedObject> impactedObjects,
List<AlarmId> relatedAlarms,
List<ManagedObject> rootCauseObjects,
ConfDatetime timeStamp,
Attribute... customAttributes)
Deprecated.
Not for public use, The isCleared flag is intended to be
set by NCS and not by the constructor
This method is expected to be retained only as a package
private method. Replaced by
Alarm(ManagedDevice,
ManagedObject,
ConfIdentityRef,
ConfBuf,
PerceivedSeverity,
ConfBuf,
List,
List,
List,
ConfDatetime,
Attribute...) |
Alarm(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)
Creates an alarm
|
Alarm(ManagedDevice managedDevice,
ManagedObject managedObject,
ConfIdentityRef alarmType,
PerceivedSeverity severity,
boolean isCleared,
String alarmText,
List<ManagedObject> impactedObjects,
List<AlarmId> relatedAlarms,
List<ManagedObject> rootCauseObjects,
ConfDatetime timeStamp,
Attribute... customAttributes)
Deprecated.
Not for public use, The isCleared flag is intended to be
set by NCS and not by the constructor
This method is expected to be retained only as a package
private method. Replaced by
Alarm(ManagedDevice,
ManagedObject,
ConfIdentityRef,
PerceivedSeverity,
ConfBuf,
List,
List,
List,
ConfDatetime,
Attribute...) |
Alarm(ManagedDevice managedDevice,
ManagedObject managedObject,
ConfIdentityRef alarmType,
PerceivedSeverity severity,
ConfBuf alarmText,
List<ManagedObject> impactedObjects,
List<AlarmId> relatedAlarms,
List<ManagedObject> rootCauseObjects,
ConfDatetime timeStamp,
Attribute... customAttributes)
Creates an alarm
|
Modifier and Type | Method and Description |
---|---|
ConfBuf |
alarmText() |
boolean |
equals(Object o)
A unique Alarm instance is the combination of
ManagedDevice ,
ManagedObject , (alarmtype)
ConfIdentityRef and
(specific problem)ConfBuf |
String |
getAlarmText()
Deprecated.
Use
Alarm.alarmText |
ConfIdentityRef |
getAlarmType() |
Attribute[] |
getCustomAttributes() |
List<ManagedObject> |
getImpactedObjects() |
ManagedDevice |
getManagedDevice() |
ManagedObject |
getManagedObject() |
PerceivedSeverity |
getPerceivedSeverity() |
List<AlarmId> |
getRelatedAlarms() |
List<ManagedObject> |
getRootCauseObjects() |
ConfBuf |
getSpecificProblem() |
ConfDatetime |
getTimeStamp() |
int |
hashCode() |
boolean |
isCleared()
Return true if this alarm has been cleared by
the underlying resource.
|
boolean |
isLastAlarm() |
static Alarm |
lastAlarm() |
String |
toString() |
@Deprecated public Alarm(ManagedDevice managedDevice, ManagedObject managedObject, ConfIdentityRef alarmType, ConfBuf specificProblem, PerceivedSeverity severity, boolean isCleared, String alarmText, List<ManagedObject> impactedObjects, List<AlarmId> relatedAlarms, List<ManagedObject> rootCauseObjects, ConfDatetime timeStamp, Attribute... customAttributes)
Alarm(ManagedDevice,
ManagedObject,
ConfIdentityRef,
ConfBuf,
PerceivedSeverity,
ConfBuf,
List,
List,
List,
ConfDatetime,
Attribute...)
public Alarm(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)
managedDevice
- The managed device for which this
alarm is associated with, plain string which identifies the device
(usually the key string in /ncs:devices/device{dev1}). I.e. dev1managedObject
- The managed object for which this
alarm is associated with. Also referred to as the "Alarming Object".
This may not be the same as the rootCause object, which is set in
the rootCauseObjects parameter.
If an NCS Service generates an alarm based on an error state in a device
used by this service, the managedObject is the service Id and the object
on the device the rootCauseObjects.alarmType
- The AlarmType this alarm is associated with. This is a YANG identity.
Alarm types are defined by the YANG developer and should be designed
to be as specific as possible.specificProblem
- If the AlarmType isn't enough to describe the Alarm, this field can
be used in combination. Keep in mind that when dynamically adding a
specific problem, there is no way for the operator to know in beforehand
which alarms that can be raised on the network.severity
- What state this alarm is in. Cleared, Indeterminate, Minor, Warning,
Major, CriticalimpactedObjects
- A list of ManagedObjects that may no longer function due to this alarm.
Typically these point to NCS Services that are dependent on the objects
on the device that reported the problem.
In NCS 2.3 and later there is a backpointer attribute available on
objects in the device tree that has been created by a Service. These
backpointers are instance reference pointer that should be used as
impactedObjects.relatedAlarms
- References to other alarms that have been generated as a consequence of
this alarm, or that has a relation to this alarm.rootCauseObjects
- ManagedObjects that are likely to be the root cause of this alarm. This
is different from the "alarming object". See managedObject above for
details.timeStamp
- A date-and-time when this alarm was generatedcustomAttributes
- @Deprecated public Alarm(ManagedDevice managedDevice, ManagedObject managedObject, ConfIdentityRef alarmType, PerceivedSeverity severity, boolean isCleared, String alarmText, List<ManagedObject> impactedObjects, List<AlarmId> relatedAlarms, List<ManagedObject> rootCauseObjects, ConfDatetime timeStamp, Attribute... customAttributes)
Alarm(ManagedDevice,
ManagedObject,
ConfIdentityRef,
PerceivedSeverity,
ConfBuf,
List,
List,
List,
ConfDatetime,
Attribute...)
public Alarm(ManagedDevice managedDevice, ManagedObject managedObject, ConfIdentityRef alarmType, PerceivedSeverity severity, ConfBuf alarmText, List<ManagedObject> impactedObjects, List<AlarmId> relatedAlarms, List<ManagedObject> rootCauseObjects, ConfDatetime timeStamp, Attribute... customAttributes)
managedDevice
- The managed device for which this
alarm is associated with, plain string which identifies the device
(usually the key string in /ncs:devices/device{dev1}). I.e. dev1managedObject
- The managed object for which this
alarm is associated with. Also referred to as the "Alarming Object".
This may not be the same as the rootCause object, which is set in
the rootCauseObjects parameter.
If an NCS Service generates an alarm based on an error state in a device
used by this service, the managedObject is the service Id and the object
on the device the rootCauseObjects.alarmType
- The AlarmType this alarm is associated with. This is a YANG identity.
Alarm types are defined by the YANG developer and should be designed
to be as specific as possible.severity
- What state this alarm is in. Cleared, Indeterminate, Minor, Warning,
Major, CriticalalarmText
- A human readable description of this problem.impactedObjects
- A list of ManagedObjects that may no longer function due to this alarm.
Typically these point to NCS Services that are dependent on the objects
on the device that reported the problem.
In NCS 2.3 and later there is a backpointer attribute available on
objects in the device tree that has been created by a Service. These
backpointers are instance reference pointer that should be used as
impactedObjects.relatedAlarms
- References to other alarms that have been generated as a consequence of
this alarm, or that has a relation to this alarm.rootCauseObjects
- ManagedObjects that are likely to be the root cause of this alarm. This
is different from the "alarming object". See managedObject above for
details.timeStamp
- A date-and-time when this alarm was generatedcustomAttributes
- public boolean isCleared()
public static Alarm lastAlarm()
public boolean isLastAlarm()
public ManagedObject getManagedObject()
public ManagedDevice getManagedDevice()
public ConfIdentityRef getAlarmType()
public ConfBuf getSpecificProblem()
public PerceivedSeverity getPerceivedSeverity()
public List<ManagedObject> getImpactedObjects()
public List<ManagedObject> getRootCauseObjects()
public ConfDatetime getTimeStamp()
public Attribute[] getCustomAttributes()
@Deprecated public String getAlarmText()
Alarm.alarmText
public ConfBuf alarmText()
public boolean equals(Object o)
A unique Alarm instance is the combination of ManagedDevice
,
ManagedObject
, (alarmtype)
ConfIdentityRef
and
(specific problem)ConfBuf