public class Alarm
extends java.lang.Object
implements java.io.Serializable
A predefined business object for an alarm condition in a managed telecom object. Its definition is based on the OSS/J Quality of the Service API.
In TWaver, the alarm object used to present the OSS server side alarm. The alarm objects can be created from the client side, or created from server side and transfered to the client side. Alarm objects can be serialized or encode into XML format.
TWaver alarm just define the most general and most often used properties for client side. That is, the class is just designed for client side. Normally the OSS server side has a more comprehensive alarm object which may carry more business informations. The client side alarm can be consider as a simplified version for the server side alarm, and carry the information which need to present on the client. TWaver alarm is a very lightweight class, you can create millions alarm objects and load it into TWaver DataBox.
All TWaver alarms saved in AlarmModel, which is an alarm container of DataBox.
Use TDataBox.getAlarmModel()
to access AlarmModel. Each alarm object
can be specified an ElementID property. If the ElementID value is not null, then
AlarmModel will try to find the related element object and change its alarm state
automatically.
Alarm object can be customized to carry more additional informations.
Just like twaver.Element
, use client properties mechanism to
define and retrieve the customized properties.
Alarm alarm=new Alarm("ALM001"); alarm.setElementID("node1"); alarm.setAlarmSeverity(AlarmSeverity.CRITICAL); alarm.setAcked(true); box.getAlarmModel().addAlarm(alarm);
TDataBox
,
AlarmModel
,
Serialized FormModifier and Type | Field and Description |
---|---|
static java.lang.String |
PROPERTY_ACKED |
static java.lang.String |
PROPERTY_ACKTIME |
static java.lang.String |
PROPERTY_ACKUSERID |
static java.lang.String |
PROPERTY_ADDITIONALTEXT |
static java.lang.String |
PROPERTY_ALARMID |
static java.lang.String |
PROPERTY_ALARMSEVERITY |
static java.lang.String |
PROPERTY_ALARMTYPE |
static java.lang.String |
PROPERTY_CLEARED |
static java.lang.String |
PROPERTY_CLEAREDTIME |
static java.lang.String |
PROPERTY_CLEARUSERID |
static java.lang.String |
PROPERTY_COMMENTS |
static java.lang.String |
PROPERTY_CORRELATEDALARMS |
static java.lang.String |
PROPERTY_ELEMENTID |
static java.lang.String |
PROPERTY_LASTCHANGEDTIME |
static java.lang.String |
PROPERTY_PROBABLECAUSE |
static java.lang.String |
PROPERTY_PROPOSEDREPAIRACTION |
static java.lang.String |
PROPERTY_RAISEDTIME |
static java.lang.String |
PROPERTY_SPECIFICPROBLEM |
static java.lang.String |
PROPERTY_TRENDINDICATION |
Constructor and Description |
---|
Alarm()
create default alarm instance.
|
Alarm(java.lang.Object alarmID)
Create an alarm instance by specified ID.
|
Alarm(java.lang.Object elementID,
AlarmSeverity severity)
create an alarm instance occurred on specified element ID with
given alarm severity.
|
Alarm(java.lang.Object alarmID,
java.lang.Object elementID)
create an alarm instance occurred on specified element
by specified ID.
|
Alarm(java.lang.Object alarmID,
java.lang.Object elementID,
AlarmSeverity severity)
create an alarm instance which has specified ID, occurred
on the element id, and has the specified severity.
|
Modifier and Type | Method and Description |
---|---|
void |
addComment(java.lang.String comment)
Add a comment for the alarm.
|
void |
addCorrelatedAlarmID(java.lang.Object correlatedAlarmID)
Add a correlated alarm id for this alarm.
|
java.util.Date |
getAckTime()
Date of the last modification of the acknowledged state.
|
java.lang.String |
getAckUserID()
Identifier of the author of the last modification of the acknowledged state.
|
java.lang.String |
getAdditionalText()
Additional information about the alarm.
|
java.lang.Object |
getAlarmID()
Identifier of the alarm.
|
AlarmSeverity |
getAlarmSeverity()
The perceived severity of the alarm.
|
AlarmType |
getAlarmType()
The type of alarm.
|
java.util.Date |
getClearedTime()
Date when the perceived severity of the alarm was changed to Cleared.
|
java.lang.String |
getClearUserID()
Identifier of the author of the last request to clear the alarm.
|
java.util.Map |
getClientProperties()
Retrieve all client properties on the alarm.
|
java.lang.Object |
getClientProperty(java.lang.Object key)
Get the client property value via the given key value.
|
java.util.Collection |
getComments()
Get all alarm comments.
|
java.util.Collection |
getCorrelatedAlarmIDs()
The correlated alarm identifiers.
|
java.lang.Object |
getElementID()
Element id of the managed object
instance in which the alarm occurred.
|
java.util.Date |
getLastChangedTime()
Date of the last modification of alarm attribute values.
|
static java.util.Iterator |
getPredefinedProperties()
Returns an iterator over the all predefined properties.
|
AlarmProbableCause |
getProbableCause()
The probable cause of the alarm.
|
java.beans.PropertyChangeSupport |
getPropertyChangeSupport()
Get property change support object.
|
java.lang.String |
getProposedRepairAction()
The proposed repair actions.
|
java.util.Date |
getRaisedTime()
Date when the alarm was raised.
|
java.lang.String |
getSpecificProblem()
The specific problem.
|
AlarmTrendIndication |
getTrendIndication()
The trend indication.
|
int |
hashCode() |
boolean |
isAcked()
The acknowledged state of the alarm.
|
boolean |
isCleared()
Whether this alarm is cleared.
|
static boolean |
isPredefinedProperty(java.lang.String propertyName)
Checks whether the given property name is a predefined property.
|
void |
putClientProperty(java.lang.Object key,
boolean value)
Adds an new boolean type value for a specified client property.
|
void |
putClientProperty(java.lang.Object key,
int value)
Adds an new integer type value for a specified client property.
|
void |
putClientProperty(java.lang.Object key,
java.lang.Object value)
Set the client property for the alarm.
|
void |
setAcked(boolean acked)
Set the acknowledged value
|
void |
setAckTime(java.util.Date ackTime)
Set the acknowledged time
|
void |
setAckUserID(java.lang.String ackUserID)
Set the acknowledged user id.
|
void |
setAdditionalText(java.lang.String additionalText)
Set the additional text for the alarm
|
void |
setAlarmSeverity(AlarmSeverity alarmSeverity)
Set the severity of the alarm
|
void |
setAlarmType(AlarmType alarmType)
Set the alarm type
|
void |
setCleared(boolean cleared)
Set the alarm cleared value.
|
void |
setClearedTime(java.util.Date clearedTime)
Set the alarm cleared time.
|
void |
setClearUserID(java.lang.String clearUserID)
Set the user id who clear the alarm.
|
void |
setElementID(java.lang.Object elementID)
Set the element id for this alarm.
|
void |
setLastChangedTime(java.util.Date lastChangedTime)
Set the last change time for the alarm.
|
void |
setProbableCause(AlarmProbableCause probableCause)
Set the probable cause for this alarm.
|
void |
setProposedRepairAction(java.lang.String proposedRepairAction)
Set the proposed repair action for this alarm.
|
void |
setRaisedTime(java.util.Date raisedTime)
Set the raised time for this alarm.
|
void |
setSpecificProblem(java.lang.String specificProblem)
Set specific problem for this alarm.
|
void |
setTrendIndication(AlarmTrendIndication trendIndication)
Set trend indication for this alarm.
|
public static final java.lang.String PROPERTY_ALARMID
public static final java.lang.String PROPERTY_ACKED
public static final java.lang.String PROPERTY_ACKTIME
public static final java.lang.String PROPERTY_ACKUSERID
public static final java.lang.String PROPERTY_ADDITIONALTEXT
public static final java.lang.String PROPERTY_ALARMSEVERITY
public static final java.lang.String PROPERTY_ALARMTYPE
public static final java.lang.String PROPERTY_CLEAREDTIME
public static final java.lang.String PROPERTY_CLEARUSERID
public static final java.lang.String PROPERTY_COMMENTS
public static final java.lang.String PROPERTY_CORRELATEDALARMS
public static final java.lang.String PROPERTY_ELEMENTID
public static final java.lang.String PROPERTY_TRENDINDICATION
public static final java.lang.String PROPERTY_SPECIFICPROBLEM
public static final java.lang.String PROPERTY_RAISEDTIME
public static final java.lang.String PROPERTY_PROPOSEDREPAIRACTION
public static final java.lang.String PROPERTY_PROBABLECAUSE
public static final java.lang.String PROPERTY_LASTCHANGEDTIME
public static final java.lang.String PROPERTY_CLEARED
public Alarm()
public Alarm(java.lang.Object alarmID)
alarmID
- Objectpublic Alarm(java.lang.Object alarmID, java.lang.Object elementID)
id
- Object the alarm id.elementID
- Element ID the alarm occurred element id.public Alarm(java.lang.Object elementID, AlarmSeverity severity)
elementID
- Objectseverity
- AlarmSeveritypublic Alarm(java.lang.Object alarmID, java.lang.Object elementID, AlarmSeverity severity)
id
- Object alarm idelementID
- Object element idseverity
- AlarmSeverity alarm severitypublic static boolean isPredefinedProperty(java.lang.String propertyName)
propertyName
- the property name to be checked.public static java.util.Iterator getPredefinedProperties()
public boolean isAcked()
public java.util.Date getAckTime()
public java.lang.String getAckUserID()
public AlarmSeverity getAlarmSeverity()
public AlarmType getAlarmType()
public java.util.Date getClearedTime()
public java.lang.String getClearUserID()
public java.util.Collection getComments()
public java.util.Collection getCorrelatedAlarmIDs()
public java.lang.Object getElementID()
public java.util.Date getLastChangedTime()
public AlarmProbableCause getProbableCause()
public java.lang.String getProposedRepairAction()
public java.util.Date getRaisedTime()
public java.lang.String getSpecificProblem()
public AlarmTrendIndication getTrendIndication()
public void setAcked(boolean acked)
acked
- boolean the new the acknowledged valuepublic void setAckTime(java.util.Date ackTime)
ackTime
- Date the new acknowledged timepublic void setAckUserID(java.lang.String ackUserID)
ackUserID
- String the acknowledged user idpublic void setAdditionalText(java.lang.String additionalText)
additionalText
- String the new additional text valuepublic void setAlarmSeverity(AlarmSeverity alarmSeverity)
alarmSeverity
- AlarmSeverity the new alarm severity valuepublic void setAlarmType(AlarmType alarmType)
alarmType
- AlarmType the alarm type valuepublic void setClearedTime(java.util.Date clearedTime)
clearedTime
- Date the alarm cleared time.public void setClearUserID(java.lang.String clearUserID)
clearUserID
- String the user idpublic void addComment(java.lang.String comment)
comment
- String the comment need to addpublic void addCorrelatedAlarmID(java.lang.Object correlatedAlarmID)
correlatedAlarmID
- Object the correlated alarm id.public void setElementID(java.lang.Object elementID)
elementID
- Object the new related element idpublic void setTrendIndication(AlarmTrendIndication trendIndication)
trendIndication
- AlarmTrendIndication the new trend indication value.public void setSpecificProblem(java.lang.String specificProblem)
specificProblem
- String the new specific problempublic void setRaisedTime(java.util.Date raisedTime)
raisedTime
- Date the raised time valuepublic void setProposedRepairAction(java.lang.String proposedRepairAction)
proposedRepairAction
- String the proposed repair action value.public void setProbableCause(AlarmProbableCause probableCause)
probableCause
- AlarmProbableCause the the probable cause value.public void setLastChangedTime(java.util.Date lastChangedTime)
lastChangedTime
- Date the last change time value.public java.lang.String getAdditionalText()
public java.lang.Object getAlarmID()
public boolean isCleared()
public void setCleared(boolean cleared)
cleared
- boolean the new alarm cleared valuepublic int hashCode()
hashCode
in class java.lang.Object
public java.beans.PropertyChangeSupport getPropertyChangeSupport()
public java.lang.Object getClientProperty(java.lang.Object key)
key
- Object the client property key.public void putClientProperty(java.lang.Object key, java.lang.Object value)
key
- Object the new property key.value
- Object the new property value.public void putClientProperty(java.lang.Object key, int value)
key
- the client property keyvalue
- the new client property value;putClientProperty(Object, Object)
public void putClientProperty(java.lang.Object key, boolean value)
key
- the client property keyvalue
- the new client property value;putClientProperty(Object, Object)
public java.util.Map getClientProperties()
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.