javax.slee.facilities
Class AlarmLevel

java.lang.Object
  extended by javax.slee.facilities.AlarmLevel
All Implemented Interfaces:
java.io.Serializable

public final class AlarmLevel
extends java.lang.Object
implements java.io.Serializable

This class defines an enumerated type for the alarm levels supported by the Alarm Facility. The alarm levels match those defined by ITU X.733.

A singleton instance of each enumerated value is guaranteed (via an implementation of readResolve() - refer java.io.Serializable), so that equality tests using == are always evaluated correctly. (This equality test is only guaranteed if this class is loaded in the application's boot class path, rather than dynamically loaded at runtime.)

The alarm levels, in order of relative severity, are:

Since:
SLEE 1.1
See Also:
Serialized Form

Field Summary
static AlarmLevel CLEAR
          Alarm level used when an error condition has cleared.
static java.lang.String CLEAR_STRING
          A string representation of CLEAR.
static AlarmLevel CRITICAL
          Alarm level used for critical error conditions.
static java.lang.String CRITICAL_STRING
          A string representation of CRITICAL.
static AlarmLevel INDETERMINATE
          Alarm level used when the severity of the error condition is unknown.
static java.lang.String INDETERMINATE_STRING
          A string representation of INDETERMINATE.
static int LEVEL_CLEAR
          An integer representation of CLEAR.
static int LEVEL_CRITICAL
          An integer representation of CRITICAL.
static int LEVEL_INDETERMINATE
          An integer representation of INDETERMINATE.
static int LEVEL_MAJOR
          An integer representation of MAJOR.
static int LEVEL_MINOR
          An integer representation of MINOR.
static int LEVEL_WARNING
          An integer representation of WARNING.
static AlarmLevel MAJOR
          Alarm level used for error conditions of major severity.
static java.lang.String MAJOR_STRING
          A string representation of MAJOR.
static AlarmLevel MINOR
          Alarm level used for error conditions of minor severity.
static java.lang.String MINOR_STRING
          A string representation of MINOR.
static AlarmLevel WARNING
          Alarm level used to indicate alarm warning conditions.
static java.lang.String WARNING_STRING
          A string representation of WARNING.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compare this alarm level for equality with another.
static AlarmLevel fromInt(int level)
          Get an AlarmLevel object from an integer value.
static AlarmLevel fromString(java.lang.String level)
          Get an AlarmLevel object from a string value.
 int hashCode()
          Get a hash code value for this alarm level.
 boolean isClear()
          Determine if this AlarmLevel object represents the CLEAR alarm level.
 boolean isCritical()
          Determine if this AlarmLevel object represents the CRITICAL alarm level.
 boolean isHigherLevel(AlarmLevel other)
          Determine if this AlarmLevel object represents a level that is higher than some other AlarmLevel object.
 boolean isIndeterminate()
          Determine if this AlarmLevel object represents the INDETERMINATE alarm level.
 boolean isMajor()
          Determine if this AlarmLevel object represents the MAJOR alarm level.
 boolean isMinor()
          Determine if this AlarmLevel object represents the MINOR alarm level.
 boolean isWarning()
          Determine if this AlarmLevel object represents the WARNING alarm level.
 int toInt()
          Get an integer value representation for this AlarmLevel object.
 java.lang.String toString()
          Get the textual representation of this alarm level object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LEVEL_CLEAR

public static final int LEVEL_CLEAR
An integer representation of CLEAR.

See Also:
Constant Field Values

LEVEL_CRITICAL

public static final int LEVEL_CRITICAL
An integer representation of CRITICAL.

See Also:
Constant Field Values

LEVEL_MAJOR

public static final int LEVEL_MAJOR
An integer representation of MAJOR.

See Also:
Constant Field Values

LEVEL_WARNING

public static final int LEVEL_WARNING
An integer representation of WARNING.

See Also:
Constant Field Values

LEVEL_INDETERMINATE

public static final int LEVEL_INDETERMINATE
An integer representation of INDETERMINATE.

See Also:
Constant Field Values

LEVEL_MINOR

public static final int LEVEL_MINOR
An integer representation of MINOR.

See Also:
Constant Field Values

CLEAR_STRING

public static final java.lang.String CLEAR_STRING
A string representation of CLEAR.

See Also:
Constant Field Values

CRITICAL_STRING

public static final java.lang.String CRITICAL_STRING
A string representation of CRITICAL.

See Also:
Constant Field Values

MAJOR_STRING

public static final java.lang.String MAJOR_STRING
A string representation of MAJOR.

See Also:
Constant Field Values

WARNING_STRING

public static final java.lang.String WARNING_STRING
A string representation of WARNING.

See Also:
Constant Field Values

INDETERMINATE_STRING

public static final java.lang.String INDETERMINATE_STRING
A string representation of INDETERMINATE.

See Also:
Constant Field Values

MINOR_STRING

public static final java.lang.String MINOR_STRING
A string representation of MINOR.

See Also:
Constant Field Values

CLEAR

public static final AlarmLevel CLEAR
Alarm level used when an error condition has cleared.


CRITICAL

public static final AlarmLevel CRITICAL
Alarm level used for critical error conditions. The critical severity level indicates that a condition affecting service has occurred and immediate corrective action is required. For example, a monitored resource has become totally incapacitated and its full capability must be restored.


MAJOR

public static final AlarmLevel MAJOR
Alarm level used for error conditions of major severity. The major severity level indicates that a condition affecting service has occurred and urgent corrective action is required. For example, a monitored resource has experienced severe degradation in its capability and full capability must be restored.


WARNING

public static final AlarmLevel WARNING
Alarm level used to indicate alarm warning conditions. The warning severity level indicates the detection of a potential or impending fault that may affect service, before any significant effects have been encountered. Action should be taken to further diagnose (if necessary) and correct the problem in order to prevent a more serious (eg. service-affecting) fault.


INDETERMINATE

public static final AlarmLevel INDETERMINATE
Alarm level used when the severity of the error condition is unknown.


MINOR

public static final AlarmLevel MINOR
Alarm level used for error conditions of minor severity. The minor severity level indicates that a condition has occurred that does not directly affect service, however corrective action should be taken in order to prevent a more serious (eg. service-affecting) fault. An alarm of minor severity could be reported, for example, when the detected alarm condition is not currently degrading the capability of the monitored resource.

Method Detail

fromInt

public static AlarmLevel fromInt(int level)
                          throws java.lang.IllegalArgumentException
Get an AlarmLevel object from an integer value.

Parameters:
level - the level as an integer.
Returns:
an AlarmLevel object corresponding to level.
Throws:
java.lang.IllegalArgumentException - if level is not a valid alarm level value.

fromString

public static AlarmLevel fromString(java.lang.String level)
                             throws java.lang.NullPointerException,
                                    java.lang.IllegalArgumentException
Get an AlarmLevel object from a string value.

Parameters:
level - the level as a string, for example as returned by the toString() method (case insensitive).
Returns:
an AlarmLevel object corresponding to level.
Throws:
java.lang.NullPointerException - if level is null.
java.lang.IllegalArgumentException - if level is not a valid alarm level string.

toInt

public int toInt()
Get an integer value representation for this AlarmLevel object.

Returns:
an integer value representation for this AlarmLevel object.

isClear

public boolean isClear()
Determine if this AlarmLevel object represents the CLEAR alarm level.

This method is effectively equivalent to the conditional test: (this == CLEAR), ie. the code:

    if (alarmLevel.isClear()) ...

is interchangeable with the code:

   if (alarmLevel == AlarmLevel.CLEAR) ...

Returns:
true if this object represents the CLEAR alarm level, false otherwise.

isCritical

public boolean isCritical()
Determine if this AlarmLevel object represents the CRITICAL alarm level.

This method is effectively equivalent to the conditional test: (this == CRITICAL), ie. the code:

    if (alarmLevel.isCritical()) ...

is interchangeable with the code:

   if (alarmLevel == AlarmLevel.CRITICAL) ...

Returns:
true if this object represents the CRITICAL alarm level, false otherwise.

isMajor

public boolean isMajor()
Determine if this AlarmLevel object represents the MAJOR alarm level.

This method is effectively equivalent to the conditional test: (this == MAJOR), ie. the code:

    if (alarmLevel.isMajor()) ...

is interchangeable with the code:

   if (alarmLevel == AlarmLevel.MAJOR) ...

Returns:
true if this object represents the MAJOR alarm level, false otherwise.

isWarning

public boolean isWarning()
Determine if this AlarmLevel object represents the WARNING alarm level.

This method is effectively equivalent to the conditional test: (this == WARNING), ie. the code:

    if (alarmLevel.isWarning()) ...

is interchangeable with the code:

   if (alarmLevel == AlarmLevel.WARNING) ...

Returns:
true if this object represents the WARNING alarm level, false otherwise.

isIndeterminate

public boolean isIndeterminate()
Determine if this AlarmLevel object represents the INDETERMINATE alarm level.

This method is effectively equivalent to the conditional test: (this == INDETERMINATE), ie. the code:

    if (alarmLevel.isIndeterminate()) ...

is interchangeable with the code:

   if (alarmLevel == AlarmLevel.INDETERMINATE) ...

Returns:
true if this object represents the INDETERMINATE alarm level, false otherwise.

isMinor

public boolean isMinor()
Determine if this AlarmLevel object represents the MINOR alarm level.

This method is effectively equivalent to the conditional test: (this == MINOR), ie. the code:

    if (alarmLevel.isMinor()) ...

is interchangeable with the code:

   if (alarmLevel == AlarmLevel.MINOR) ...

Returns:
true if this object represents the MINOR alarm level, false otherwise.

isHigherLevel

public boolean isHigherLevel(AlarmLevel other)
                      throws java.lang.NullPointerException
Determine if this AlarmLevel object represents a level that is higher than some other AlarmLevel object. For the purposes of the comparison the following order, from highest to lowest severity, is assumed for alarm levels:

Parameters:
other - the AlarmLevel object to compare this with.
Returns:
true if the level represented by this AlarmLevel object is considered a higher level than the level represented by the specified AlarmLevel object, false otherwise.
Throws:
java.lang.NullPointerException - if other is null.

equals

public boolean equals(java.lang.Object obj)
Compare this alarm level for equality with another.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this with.
Returns:
true if obj is an instance of this class representing the same alarm level as this, false otherwise.

hashCode

public int hashCode()
Get a hash code value for this alarm level.

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value.

toString

public java.lang.String toString()
Get the textual representation of this alarm level object.

Overrides:
toString in class java.lang.Object
Returns:
the textual representation of this alarm level object.


Copyright © 2009. All Rights Reserved.