Packagetwaver
Classpublic class AlarmState
InheritanceAlarmState Inheritance Object

This class provides a representation model for generic alarms carried by a telecom object. Each alarm severity present in the alarm system. It has a number of new alarms and a number of acknowledged alarms stored. It also introduces the concept of outstanding alarms, whose number is the sum of all alarms, whether acknowledged or not.

AlarmState is a property of Element used to store all alarm information occured on this element. Consider alarm state object as a container, small directory or map: it holds alarm count numbers for each alarm severities for new alarms and acknowledged alarms.

	 AlarmState data structure:
	 ___________________________________________________________
	 overall alarms
	      |
	    native----new-----severity 1           total number
	      |        |   |--severity 2           total number
	      |        |   |--severity n           total number
	      |        |
	      |      acknowledged----severity 1    total number
	      |                   |--severity 2    total number
	      |                   |--severity n    total number
	      |
	    propagate alarm------------------------propagated severity
	 ___________________________________________________________
	 
New alarms will change to acknowledged alarm via acknowledge action:
	 (new alarm)---------acknowledge-------->(acknowledged alarm)
	 

Please understand the difference between using alarm state and alarm object. In TWaver, you can use alarm state and simple int numbers to create and manage alarm information for elements. You can also use Alarm object to manage alarms. Both ways are all able to manage alarm information. The only difference is, AlarmState is a more low-level API and more lightweight because it just use numbers to store alarm information. Alarm object is more OO style and can carry more alarm information with alarm object. Actually, Alarm and AlarmBox still use low leve AlarmState API to manage the alarm count information. Consider Alarm object and alarm box are the higher level API. In most cases, Don't use the two mechanisms in the same time



Public Properties
 PropertyDefined By
  enablePropagation : Boolean
Chech whether alarm propagation is enabled.
AlarmState
  hasLessSevereNewAlarms : Boolean
[read-only] Check whether has more new alarms with severities less severe than the highest new alarm severity.
AlarmState
  highestAcknowledgedAlarmSeverity : AlarmSeverity
[read-only] Get the highest acknowledged alarm severity from this alarm state.
AlarmState
  highestNativeAlarmSeverity : AlarmSeverity
[read-only] Get the highest native alarm severity.
AlarmState
  highestNewAlarmSeverity : AlarmSeverity
[read-only] Get the highest new alarm severity from this alarm state.
AlarmState
  highestOverallAlarmSeverity : AlarmSeverity
[read-only] Get the highest overall alarm severity.
AlarmState
  propagateSeverity : AlarmSeverity
Get the propagated alarm severity.
AlarmState
Public Methods
 MethodDefined By
  
Constructor.
AlarmState
  
Acknowledge one alarm with specified alarm severity.
AlarmState
  
acknowledgeAllAlarms(severity:AlarmSeverity = null):void
Acknowledge all specified severity alarms.
AlarmState
  
clear():void
Clear this alarm state.
AlarmState
  
decreaseAcknowledgedAlarm(severity:AlarmSeverity, decrement:uint = 1):void
Decrease specified number acknowledged alarms with specified alarm severity from this alarm state object.
AlarmState
  
decreaseNewAlarm(severity:AlarmSeverity, decrement:uint = 1):void
Decrease specified number new alarms with specified alarm severity from this alarm state object.
AlarmState
  
Get total count of all acknowledged alarms of specified alarm severity.
AlarmState
  
getAlarmCount(severity:AlarmSeverity = null):int
Get total alarm count by specified alarm severity.
AlarmState
  
getNewAlarmCount(severity:AlarmSeverity = null):int
Get new alarm count for the specified alarm severity.
AlarmState
  
increaseAcknowledgedAlarm(severity:AlarmSeverity, increment:uint = 1):void
Add given number acknowledged alarms with given alarm severity.
AlarmState
  
increaseNewAlarm(severity:AlarmSeverity, increment:uint = 1):void
Add specified number new alarms with specified alarm severity.
AlarmState
  
isEmpty():Boolean
Check whether this alarm state object is empty.
AlarmState
  
Remove all acknowledged alarms for the specified alarm severity.
AlarmState
  
removeAllNewAlarms(severity:AlarmSeverity = null):void
Remove all new alarms for the specified alarm severity.
AlarmState
  
setAcknowledgedAlarmCount(severity:AlarmSeverity, count:uint):void
Set acknowledged alarm count for the specified alarm severity with the specified alarm count.
AlarmState
  
setNewAlarmCount(severity:AlarmSeverity, count:uint):void
Set new alarm count for the specified alarm severity.
AlarmState
Property Detail
enablePropagationproperty
enablePropagation:Boolean

Chech whether alarm propagation is enabled. This flag is used to tell alarm propagator whether this alarm state can be propagated. If true, you can set and change propagat severity. Otherwise, TWaver will ignore the propagated alarm severity.


Implementation
    public function get enablePropagation():Boolean
    public function set enablePropagation(value:Boolean):void
hasLessSevereNewAlarmsproperty 
hasLessSevereNewAlarms:Boolean  [read-only]

Check whether has more new alarms with severities less severe than the highest new alarm severity.


Implementation
    public function get hasLessSevereNewAlarms():Boolean
highestAcknowledgedAlarmSeverityproperty 
highestAcknowledgedAlarmSeverity:AlarmSeverity  [read-only]

Get the highest acknowledged alarm severity from this alarm state.


Implementation
    public function get highestAcknowledgedAlarmSeverity():AlarmSeverity
highestNativeAlarmSeverityproperty 
highestNativeAlarmSeverity:AlarmSeverity  [read-only]

Get the highest native alarm severity. Read above class comments to know more about overall alarm, propagate alarm, and native alarm.


Implementation
    public function get highestNativeAlarmSeverity():AlarmSeverity
highestNewAlarmSeverityproperty 
highestNewAlarmSeverity:AlarmSeverity  [read-only]

Get the highest new alarm severity from this alarm state.


Implementation
    public function get highestNewAlarmSeverity():AlarmSeverity
highestOverallAlarmSeverityproperty 
highestOverallAlarmSeverity:AlarmSeverity  [read-only]

Get the highest overall alarm severity. Read above class comments to know more about overall alarm, propagate alarm, and native alarm.


Implementation
    public function get highestOverallAlarmSeverity():AlarmSeverity
propagateSeverityproperty 
propagateSeverity:AlarmSeverity

Get the propagated alarm severity. The propagated alarm is the alarm comes from the related element which may has very close business relationship with current element object. In TWaver, ElementBox use a alamr propagator to propagate alarms. The default implementation is to propagate alarms to element's parent.


Implementation
    public function get propagateSeverity():AlarmSeverity
    public function set propagateSeverity(value:AlarmSeverity):void
Constructor Detail
AlarmState()Constructor
public function AlarmState(element:IElement)

Constructor.

Parameters
element:IElement — Create alarm state object and connect to this given element.
Method Detail
acknowledgeAlarm()method
public function acknowledgeAlarm(severity:AlarmSeverity):void

Acknowledge one alarm with specified alarm severity. For this alarm severity, new alarm count +1, acknowledged alarm -1.

Parameters

severity:AlarmSeverity — the alarm severity to be acknowledged.

acknowledgeAllAlarms()method 
public function acknowledgeAllAlarms(severity:AlarmSeverity = null):void

Acknowledge all specified severity alarms. For this alarm severity, new alarm count will be zero, the number will be moved to acknowledged alarm count.

Parameters

severity:AlarmSeverity (default = null) — the alarm severity to be acknowledged

clear()method 
public function clear():void

Clear this alarm state. This will set all new/acknowledged alarm counts for all alarm severities to zero.

decreaseAcknowledgedAlarm()method 
public function decreaseAcknowledgedAlarm(severity:AlarmSeverity, decrement:uint = 1):void

Decrease specified number acknowledged alarms with specified alarm severity from this alarm state object.

Parameters

severity:AlarmSeverity — the alarm severity to be decreased
 
decrement:uint (default = 1) — how many alarms need to be removed

decreaseNewAlarm()method 
public function decreaseNewAlarm(severity:AlarmSeverity, decrement:uint = 1):void

Decrease specified number new alarms with specified alarm severity from this alarm state object.

Parameters

severity:AlarmSeverity — the alarm severity to be decreased
 
decrement:uint (default = 1) — how many alarms need to be removed

getAcknowledgedAlarmCount()method 
public function getAcknowledgedAlarmCount(severity:AlarmSeverity = null):int

Get total count of all acknowledged alarms of specified alarm severity.

Parameters

severity:AlarmSeverity (default = null) — the alarm severity need to get

Returns
int — total count of all acknowledged alarms of specified alarm severity.
getAlarmCount()method 
public function getAlarmCount(severity:AlarmSeverity = null):int

Get total alarm count by specified alarm severity. This will be the total of all acknowledged alarm count and all new alarm count.

Parameters

severity:AlarmSeverity (default = null) — the alarm severity

Returns
int — total alarm count of the specified alarm severity
getNewAlarmCount()method 
public function getNewAlarmCount(severity:AlarmSeverity = null):int

Get new alarm count for the specified alarm severity.

Parameters

severity:AlarmSeverity (default = null) — the alarm severity

Returns
int — new alarm count for the specified alarm severity.
increaseAcknowledgedAlarm()method 
public function increaseAcknowledgedAlarm(severity:AlarmSeverity, increment:uint = 1):void

Add given number acknowledged alarms with given alarm severity.

Parameters

severity:AlarmSeverity — the alarm severity to be increased.
 
increment:uint (default = 1) — how many alarms to be increased.

increaseNewAlarm()method 
public function increaseNewAlarm(severity:AlarmSeverity, increment:uint = 1):void

Add specified number new alarms with specified alarm severity.

Parameters

severity:AlarmSeverity — the new alarm severity
 
increment:uint (default = 1) — how many new alarms need to be added

isEmpty()method 
public function isEmpty():Boolean

Check whether this alarm state object is empty. Empty means no any new alarm or acknowledged alarm for any alarm severities.

Returns
Boolean — true means empty, false otherwise.
removeAllAcknowledgedAlarms()method 
public function removeAllAcknowledgedAlarms(severity:AlarmSeverity = null):void

Remove all acknowledged alarms for the specified alarm severity. This will reset the acknowledged alarm count to zero for this severity.

Parameters

severity:AlarmSeverity (default = null) — the alarm severity to be removed.

removeAllNewAlarms()method 
public function removeAllNewAlarms(severity:AlarmSeverity = null):void

Remove all new alarms for the specified alarm severity. This will set new alarm count to zero for the specified alarm severity.

Parameters

severity:AlarmSeverity (default = null) — the alarm severity to be removed

setAcknowledgedAlarmCount()method 
public function setAcknowledgedAlarmCount(severity:AlarmSeverity, count:uint):void

Set acknowledged alarm count for the specified alarm severity with the specified alarm count.

Parameters

severity:AlarmSeverity — the alarm severity to be set
 
count:uint — the acknowledged alarm count for this severity

setNewAlarmCount()method 
public function setNewAlarmCount(severity:AlarmSeverity, count:uint):void

Set new alarm count for the specified alarm severity.

Parameters

severity:AlarmSeverity — alarm severity need to set
 
count:uint — the new alarm count for this alarm severity