Packagetwaver
Classpublic class AlarmSeverity
InheritanceAlarmSeverity Inheritance Object

This class defines the severities for telecom network alarms. In TWaver, every alarm event has a level of severity, known as the alarm's "severity". The alarm severity indicates the severe level of the alarm and user should handle the alarm even in the order of this severity level. TWaver predefines alarm severities in this class for you to use directly. You can also customize or create new severities according to your needs.

Every alarm severity defines a nickname string, most of the time, the nickname is just one letter long. This nickname will be displayed in the alarm bubble to indicate the severity.

Also every severity has a color. Normally you don't need to change the color of the predefined severities. However you can do it even in the runtime if you really need to change the default colors. When the color is changed, all views will be changed in the same time and you don't need to restart your application.

See also

twaver.Alarm


Public Properties
 PropertyDefined By
  CLEARED : AlarmSeverity
[static]
AlarmSeverity
  clearedAlarmSeverity : AlarmSeverity
[static] Get the alarm severity which one is present the "alarm is cleared".
AlarmSeverity
  color : uint
Get alarm severity color.
AlarmSeverity
  compareFunction : Function
[static] Get the comparator function.
AlarmSeverity
  count : int
[static] [read-only] Get the total count of all predefined alarm severities.
AlarmSeverity
  CRITICAL : AlarmSeverity
[static]
AlarmSeverity
  displayName : String
Get display name of this alarm severity.
AlarmSeverity
  INDETERMINATE : AlarmSeverity
[static]
AlarmSeverity
  MAJOR : AlarmSeverity
[static]
AlarmSeverity
  MINOR : AlarmSeverity
[static]
AlarmSeverity
  name : String
[read-only] Get alarm severity name.
AlarmSeverity
  nickName : String
Get alarm severity nick name.
AlarmSeverity
  severities : ICollection
[static] [read-only] Get all predefined alarm severities as a collection.
AlarmSeverity
  value : int
[read-only] Get alarm severity severe value.
AlarmSeverity
  WARNING : AlarmSeverity
[static]
AlarmSeverity
Public Methods
 MethodDefined By
  
AlarmSeverity(value:int, name:String, nickName:String, color:uint, displayName:String = null)
AlarmSeverity
  
addAlarmSeverityChangeListener(listener:Function, priority:int = 0):void
[static] Add a listener to this class to monitoring the change of alarm severity.
AlarmSeverity
  
[static] The predefined alarm severity comparator which sorts the alarm severity in ascending order.
AlarmSeverity
  
clear():void
[static] Clear all predefined alarm severities.
AlarmSeverity
  
compare(severity1:AlarmSeverity, severity2:AlarmSeverity):int
[static] Compare specified two alarm severity objects which one is more severe.
AlarmSeverity
  
[static] The predefined alarm severity comparator which sorts the alarm severity in descending order.
AlarmSeverity
  
forEach(callbackFunction:Function):void
[static] Iterate the alarm severities.
AlarmSeverity
  
[static] Get the predefined alarm severity by severity name.
AlarmSeverity
  
[static] Get predefined alarm severity by severity value.
AlarmSeverity
  
[static] Check whether the given alarm severity is the cleared severity.
AlarmSeverity
  
register(value:int, name:String, nickName:String, color:uint, displayName:String = null):AlarmSeverity
[static] Register a new predefined alarm severity into this class.
AlarmSeverity
  
removeAlarmSeverityChangeListener(listener:Function):void
[static] Remove a installed listener from this class.
AlarmSeverity
  
toString():String
AlarmSeverity
  
[static] Remove the registered alarm severity from this class.
AlarmSeverity
Property Detail
CLEAREDproperty
public static var CLEARED:AlarmSeverity

clearedAlarmSeverityproperty 
clearedAlarmSeverity:AlarmSeverity

Get the alarm severity which one is present the "alarm is cleared". Cleared severity is a special alarm severity which means the the problem combines with original alarm is recovered.


Implementation
    public static function get clearedAlarmSeverity():AlarmSeverity
    public static function set clearedAlarmSeverity(value:AlarmSeverity):void
colorproperty 
color:uint

Get alarm severity color.


Implementation
    public function get color():uint
    public function set color(value:uint):void
compareFunctionproperty 
compareFunction:Function

Get the comparator function.


Implementation
    public static function get compareFunction():Function
    public static function set compareFunction(value:Function):void
countproperty 
count:int  [read-only]

Get the total count of all predefined alarm severities.


Implementation
    public static function get count():int
CRITICALproperty 
public static var CRITICAL:AlarmSeverity

displayNameproperty 
displayName:String

Get display name of this alarm severity.


Implementation
    public function get displayName():String
    public function set displayName(value:String):void
INDETERMINATEproperty 
public static var INDETERMINATE:AlarmSeverity

MAJORproperty 
public static var MAJOR:AlarmSeverity

MINORproperty 
public static var MINOR:AlarmSeverity

nameproperty 
name:String  [read-only]

Get alarm severity name. For example "Critical".


Implementation
    public function get name():String
nickNameproperty 
nickName:String

Get alarm severity nick name. This nickname normally is a short one-letter name and will be used to display the alarm bubble. For example, the nickname of "Critical" will be letter "C".


Implementation
    public function get nickName():String
    public function set nickName(value:String):void
severitiesproperty 
severities:ICollection  [read-only]

Get all predefined alarm severities as a collection. return the collection of all predefined alarm severities.


Implementation
    public static function get severities():ICollection
valueproperty 
value:int  [read-only]

Get alarm severity severe value. For this default alarm severity implementation, more bigger this value is, the severity is more severe.


Implementation
    public function get value():int
WARNINGproperty 
public static var WARNING:AlarmSeverity

Constructor Detail
AlarmSeverity()Constructor
public function AlarmSeverity(value:int, name:String, nickName:String, color:uint, displayName:String = null)



Parameters
value:int
 
name:String
 
nickName:String
 
color:uint
 
displayName:String (default = null)
Method Detail
addAlarmSeverityChangeListener()method
public static function addAlarmSeverityChangeListener(listener:Function, priority:int = 0):void

Add a listener to this class to monitoring the change of alarm severity. Any change of alarm severity is occured, this listener will be notified. You can do some extra job in with this listener machnism.

Parameters

listener:Function — the alarm severity change listener.
 
priority:int (default = 0) — the priority of this listener which is when the event is dispached by the internal EventDispatcher. The default value is 0.

See also

flash.events.EventDispatcher
ASCENDING_FUNCTION()method 
public static function ASCENDING_FUNCTION(severity1:AlarmSeverity, severity2:AlarmSeverity):int

The predefined alarm severity comparator which sorts the alarm severity in ascending order. The default alarm severity comparator uses severity value to compare which one is more severe. More bigger value, more severe.

Parameters

severity1:AlarmSeverity
 
severity2:AlarmSeverity

Returns
int
clear()method 
public static function clear():void

Clear all predefined alarm severities.

compare()method 
public static function compare(severity1:AlarmSeverity, severity2:AlarmSeverity):int

Compare specified two alarm severity objects which one is more severe.

Parameters

severity1:AlarmSeverity — alarm severity 1
 
severity2:AlarmSeverity — alarm severity 2

Returns
int — for the default comparator: if result > 0, alarm severity 1 is more severe; if result = 0, the two alarm severities are equivalent; if result < 0, alarm severity 2 is more severe.
DESCENDING_FUNCTION()method 
public static function DESCENDING_FUNCTION(severity1:AlarmSeverity, severity2:AlarmSeverity):int

The predefined alarm severity comparator which sorts the alarm severity in descending order. The default alarm severity comparator uses severity value to compare which one is more severe. More bigger value, more severe.

Parameters

severity1:AlarmSeverity
 
severity2:AlarmSeverity

Returns
int
forEach()method 
public static function forEach(callbackFunction:Function):void

Iterate the alarm severities.

Parameters

callbackFunction:Function

getByName()method 
public static function getByName(name:String):AlarmSeverity

Get the predefined alarm severity by severity name.

Parameters

name:String — the alarm severity name.

Returns
AlarmSeverity — the alarm severity which name equals to the given name.
getByValue()method 
public static function getByValue(value:int):AlarmSeverity

Get predefined alarm severity by severity value.

Parameters

value:int — the alarm severity value.

Returns
AlarmSeverity — the alarm severity which value equals to the given value.
isClearedAlarmSeverity()method 
public static function isClearedAlarmSeverity(severity:AlarmSeverity):Boolean

Check whether the given alarm severity is the cleared severity.

Parameters

severity:AlarmSeverity — the severity need to check

Returns
Boolean — true if the severity is cleared alarm severity, false otherwise.
register()method 
public static function register(value:int, name:String, nickName:String, color:uint, displayName:String = null):AlarmSeverity

Register a new predefined alarm severity into this class. Use this way to create your own predefined alarm severities for your OSS software without creating a new alarm severity instance.

Parameters

value:int — the alarm severity severe value.
 
name:String — the alarm severity name.
 
nickName:String — the alarm severity nickname
 
color:uint — color of the registered alarm severity
 
displayName:String (default = null) — display name of the registered alarm severity

Returns
AlarmSeverity — the new registered alarm severity object.
removeAlarmSeverityChangeListener()method 
public static function removeAlarmSeverityChangeListener(listener:Function):void

Remove a installed listener from this class.

Parameters

listener:Function — the listener need to remove.

toString()method 
public function toString():String

Returns
String
unregister()method 
public static function unregister(name:String):AlarmSeverity

Remove the registered alarm severity from this class.

Parameters

name:String — the alarm severity name which to be removed.

Returns
AlarmSeverity — the removed alarm severity object.