|
"WEBNMS_5 API Docs" | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.adventnet.nms.alertdb.Alert
public class Alert
This class forms the basis of every Alert generated within Web NMS. For every alert reported or generated within Web NMS system, a corresponding instance of this class will be created.
Events are set of notifications from the network and are the source of information for all the management happenings that take place within the Web NMS system. Alerts are correlation of set of events representing a common failure / fault. Events are correlated to alerts based on entity field. i.e. for all events with the same entity field there will only be one alert and the severity of the alert will be the severity of the latest event with the same failure object.
A new alert will be generated from an event, if the following two conditions are met by the generated Event.
If there exists no other alert matching the same entity, as that of the event within the Web NMS system If the criticality of the Event is greater than that of 'Clear' severity.Subsequently when a new event gets generated for the same failure object the existing alert will be updated. An event could update an alert only if any one of the following conditions are met
If either the criticality of the event is greater than or equal to that of Clear and is different from the current status of the corresponding alert. (or) If either the message field of the event is different from the message field of the corresponding alert. (or) If either the source field of the event is different from the source field of the corresponding alert.The Alert class has a basic set of data fields (or standard properties) to hold values that are vital for Web NMS Management. Apart from these standard properties, additional properties (data) can also be added into the Alert object either by extending the object or using the concept of User Properties.
Often applications do not need to create their own subclasses of Alert, since it allows for easily storing custom properties in Alert itself. Alert contains a member field userProperties and methods setUserProperty(String, Object) and getUserProperty(String) which allow applications to store their data in an instance of this class, and access the data efficiently.
Like
alert.setUserProperty("userProp","NMS");
and retrieve it using the property by doing a call
String nmsString = alert.getUserProperty("userProp");
AlertAPI,
Serialized Form| Constructor Summary | |
|---|---|
Alert()
default constructor. |
|
| Method Summary | |
|---|---|
void |
clientDecodeObj(byte[] bytes)
This method is used to contruct Alert object from byte array obtained using clientEncodedObj(). |
byte[] |
clientEncodeObj()
This method is used to serialize the fields of this Alert to be sent to the client. |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
java.lang.String |
dateString()
Returns the create time of this alert as a string. |
void |
decodeObj(byte[] bytes)
This method is used to deserialize the Alert object. |
byte[] |
encodeObj()
This method is used to save this object for persistence. |
AlertAnnotation |
getAnnotation()
Constructs and returns an Alert Annotation object for this alert object. |
java.lang.String |
getCategory()
Accessor method to return the Category of the alert. |
java.awt.Color |
getColor()
Returns the color corresponding to the severity of this alert. |
long |
getCreateTime()
Get the time stamp at which this alert was created. |
java.lang.Object |
getDynamicUserProperty(java.lang.String nam)
|
java.lang.String |
getEntity()
Returns the entity field of the alert. |
Event |
getEvent()
To get the Event object from which the corresponding Alert is generated or updated. |
java.lang.String |
getGroupName()
Returns the Group Name to which this alert belongs. |
int |
getId()
Get the id of the corresponding event from which this alert is generated. |
java.lang.String |
getKey()
Method to get the key value of this Alert. |
java.lang.String |
getKeyName()
Returns the field names used as the unique key of this Alert object. |
java.lang.Object |
getLockId()
Gets the current lock object associated with the Alert. |
java.lang.String |
getMapname()
Get the the mapname of the MapSymbol corresponding to the source of this alert. |
java.util.Map |
getMappedProperties()
|
java.lang.String |
getMessage()
Returns the message describing this alert. |
long |
getModTime()
Get the time at which this alert was last modified. |
java.lang.String |
getNotes()
Get the detailed annotations about updates on this alert. |
java.lang.String |
getOwnerName()
Returns the name of the owner to which the corresponding Alert object belongs. |
int |
getPreviousSeverity()
The previous severity of this alert. |
int |
getPriority()
Returns the priority field of this Alert. |
com.adventnet.nms.common.corba.Property_CT[] |
getProperties_CT()
corba: Alert_CIOperations interface method |
java.util.Properties |
getProperties()
This method returns the values of all the fields in this alert object as a key,value pair in a java.util.Properties object. |
int |
getSeverity()
Gets the severity of the alert. |
java.lang.String |
getSource()
Get the source of the alert. |
com.adventnet.nms.common.corba.Property_CT[] |
getUserProperties_CT()
corba: Alert_CIOperations interface method |
java.util.Properties |
getUserProperties()
Get the user Properties object . |
java.lang.String |
getUserProperty(java.lang.String nam)
To get any other user property |
java.lang.String |
getWebNMS()
The WebNMS server where this alert is generated. |
java.lang.String |
getWho()
Returns the user name who has picked up this alert. |
java.lang.String |
removeUserProperty(java.lang.String nam)
To remove any other user property |
void |
setAnnotation(AlertAnnotation altan)
Sets the AlertAnnotation for this alert object. |
void |
setCategory(java.lang.String category)
This method is used to set the category of the alert, like Topology alert or Threshold alert etc. |
void |
setCreateTime(long createTime)
Set the time stamp at which this alert was created. |
void |
setDynamicUserProperty(java.lang.String key,
java.lang.Object value)
|
void |
setEntity(java.lang.String entity)
Sets the entity field of this alert. |
void |
setEvent(Event event)
To set the Event object from which the corresponding Alert is generated or updated. |
void |
setGroupName(java.lang.String group)
Method to set the Group Name to which this alert belongs. |
void |
setId(int id)
Sets the id of this alert. |
void |
setLockId(java.lang.Object lockId)
Sets the current lock object associated with the Alert. |
void |
setMapname(java.lang.String mapname)
Sets the mapname of the MapSymbol corresponding to the source of this alert. |
void |
setMappedProperties(java.util.Map mappedProps)
|
void |
setMessage(java.lang.String message)
Sets the message describing this alert. |
void |
setModTime(long modTime)
Sets the time at which this alert was last modified. |
void |
setNotes(java.lang.String notes)
Sets the detailed annotations about updates on this alert. |
void |
setOwnerName(java.lang.String owner)
To set the owner to which the corresponding Alert object belongs. |
void |
setPreviousSeverity(int previousSeverity)
The previous severity of this alert. |
void |
setPriority(int priority)
Sets the priority of the Alert. |
void |
setProperties_CT(com.adventnet.nms.common.corba.Property_CT[] property_array)
corba: Alert_CIOperations interface method |
void |
setProperties(java.util.Properties p)
This method sets the properties of the Alert Object. |
void |
setSeverity(int severity)
Sets the severity of the alert. |
void |
setSource(java.lang.String source)
sets the source of the alert. |
void |
setUserProperty(java.lang.String nam,
java.lang.String val)
To set any other user property |
void |
setValues()
Used in the client. |
void |
setWebNMS(java.lang.String webNMS)
The WebNMS server where this alert is generated. |
void |
setWho(java.lang.String who)
Sets the user name who has picked up this alert. |
java.lang.String |
severityStr()
Returns the severity of this alert as a string |
java.lang.String |
toLogString()
Returns all relevant fields of this alert in one concatinated string. |
java.lang.String |
toString()
Returns the a String which will be the concatenation of the entity field of the alert and the message field of the alert. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Alert()
| Method Detail |
|---|
public int getId()
getId in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic void setId(int id)
setId in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationsid - The value of the id field.public Event getEvent()
public void setEvent(Event event)
The transient reference could be used at the level of Alert filters to access the properties of the Event or its derived class to get additional properties needed to create / update Alert or its extended class.
This Event object is accessible only at the level of Alert Filters. Once the Alert is returned from Alert filters, the Event object reference will be set with 'null'.
event - The Event object from which the corresponding Alert is generated or updated.public java.lang.String getGroupName()
Alerts with same 'groupName' field will be grouped while displaying Alerts in the client. All the alerts belonging to the same group can be correlated as a single failure in the client. The Group Name could be set using the corresponding modifier method present in this class. This method will return 'null' if the 'groupName' field is not set.
getGroupName in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationssetGroupName(String)public void setGroupName(java.lang.String group)
setGroupName in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationsgroup - The group name to be set for this Event object.getGroupName()public java.lang.String getCategory()
getCategory in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationssetCategory(String)public java.lang.Object getLockId()
LockableObjectpublic void setLockId(java.lang.Object lockId)
lockId - is random Integer object generated by WebNMSLockableObjectpublic void setCategory(java.lang.String category)
setCategory in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationscategory - The category to which this alert belongs.getCategory()public int getSeverity()
SeverityInfo.getValue(String) to get the int representaion of the severity string.
getSeverity in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic void setSeverity(int severity)
setSeverity in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationsseverity - This severity value can be obtained using the SeverityInfo.getValue(String)
method.public int getPreviousSeverity()
getPreviousSeverity in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic void setPreviousSeverity(int previousSeverity)
setPreviousSeverity in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspreviousSeverity - The previous severity.public java.lang.String getEntity()
Events will be correlated into Alerts based on the 'entity' field and Alerts will update the corresponding Managed Object based on the 'source' field.
The 'entity' field is more specific towards identifying the problem domain and 'source' field will be used to correlate the problem with the Managed object. The 'node' field could correspond to the node object.
For example: The Agent in the printer could be configured to send notification to the server on the following cases: when the Printer Toner level goes below 10%, when the paper count goes below 50 and when Interface for the printer has problems. When Alerts are generated based on the notification for toner level the entity, source, node fields could be set with entity - printer_toner source - printer node - printer When Alerts are generated based on the notification for Interface going down, the fields could be set with entity - IF-printer_down source - IF-printer node - printer Here entity specifies the problem domain, source identifies the Managed object and node corresponds to the network object.
getEntity in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic void setEntity(java.lang.String entity)
setEntity in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationsentity - The value for the entity field.public long getCreateTime()
getCreateTime in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic void setCreateTime(long createTime)
setCreateTime in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationscreateTime - The create time of this alert, as the number of milliseconds that elapsed since Jan
1, 1970 00:00:00 GMT.public long getModTime()
getModTime in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic void setModTime(long modTime)
setModTime in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationsmodTime - The modified time of this alert.public java.lang.String getMessage()
getMessage in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic void setMessage(java.lang.String message)
setMessage in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationsmessage - The message which describes this alert.public java.lang.String getSource()
getSource in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic void setSource(java.lang.String source)
setSource in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationssource - The source of this alert.public java.lang.String getMapname()
getMapname in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic void setMapname(java.lang.String mapname)
setMapname in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationsmapname - The mapName of this alert.public java.lang.String getWho()
getWho in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic void setWho(java.lang.String who)
setWho in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationswho - The name of the user who picks up this alert.public java.lang.String getNotes()
getNotes in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic void setNotes(java.lang.String notes)
setNotes in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationsnotes - The annotations to be done from this alert.public java.lang.String getWebNMS()
getWebNMS in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic void setWebNMS(java.lang.String webNMS)
setWebNMS in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationswebNMS - NMS from which alert was generated
Not used as of WebNMS2.0public java.lang.String getOwnerName()
By Default the value of the OwnerName will be 'null'. This field is reserved for furture use. Currently users are requested not to set this field for holding any information as it may result in some undesirable effect..
public void setOwnerName(java.lang.String owner)
owner - The owner name to which this Alert belongs.public int getPriority()
public void setPriority(int priority)
priority - The priority field of this Alertpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toLogString()
toLogString in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic java.lang.String dateString()
dateString in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic java.lang.String severityStr()
severityStr in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic AlertAnnotation getAnnotation()
public void setAnnotation(AlertAnnotation altan)
altan - An instance of AlertAnnotation object for this alert object.public java.awt.Color getColor()
public byte[] encodeObj()
encodeObj in interface ConfigurableObjdecodeObj(byte[])
public void decodeObj(byte[] bytes)
throws java.io.IOException
decodeObj in interface ConfigurableObjbytes[] - Alert object in serialized form.
java.io.IOException - - IO Exception when any problem arises during deserializing.encodeObj()public byte[] clientEncodeObj()
clientDecodeObj(byte [])
public void clientDecodeObj(byte[] bytes)
throws java.io.IOException
bytes - - Alert details in the form of byte array.
java.io.IOException - - When there is any IO exception while re constructing the Alert object.clientEncodeObj()public java.util.Properties getProperties()
Derived classes should override this method and invoke the super.getProperties() in the beginning of the method inorder to correctly return super classes' properties.
For example : Let us suppose a class called MyAlert extends Alert
and has a property String myfield = "";
The getProperties method code should be,
public Properties getProperties()
{
Properties p = super.getProperties();
p.put("myfield", myfield);
return p;
}
The Properties object returned from this method will have the following
keys, to get the values of the corresponding Alert properties.id, severity,previsouseverity,createTime,modTime,state,groupName,category, entity,ownerName,priority,message,who,notes,source,mapname, stringseverity, stringpreviousseverity and all user properties. Note : All values returned will be of type String. Users have to cast the String value into appropriate type.
getProperties in interface DBInterfacesetProperties(Properties)public java.lang.Object clone()
clone in interface DBInterfaceclone in class java.lang.Objectpublic void setProperties(java.util.Properties p)
Derived classes should override this method and invoke super.setProperties() at the end of this method. It is required that after the Derived classes have set their properties they remove it from the properties object they pass when calling super.setProperties(); This is to ensure the properties are not duplicated in the userProperties too. This will ensure that the user properties reflect correctly and do not contain redundant information.
For example : Let us suppose a class called MyAlert extends
Alert and has a field String myfield = "";
In the setProperties() method (of class MyAlert) the proper code could likely be
public void setProperties(Properties p) {
if (p == null) return;
if ((s = p.getProperty("myfield")) != null) {
myfield= s;
p.remove("myfield");
}
super.setProperties(p);
}
It should be noted that for the properties of the alert that are not passed within the Properties object arguement, the previous values or default values will be retained.
setProperties in interface DBInterfacep - The java.lang.Properties object that contains the properties
to be set for the Alert Object. The key value should either exactly
match the name of any standard property field in the Alert Object or it will be considered
as a User property to be set for the Alert Object.
The following are the keys to be used in the argument Properties object, for the corresponding property of the Alert.
id, severity,previsouseverity,createTime,modTime,state,groupName,category, entity,ownerName,priority,message,who,notes,source,mapname, stringseverity, stringpreviousseverity and all user properties. Note : All values must be specified as strings. The setProperties() method implementation should take care of casting the values to the appropriate type.
getProperties()public void setValues()
setValues in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic java.lang.String getKey()
Since the key field could be either entity when ownerName field is 'null' and combination of entity and ownerName when ownerName field is not 'null', users are suggested to use this method to get the key value for an Alert.
getKey in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationsgetKey in interface DBInterfacepublic java.lang.String getKeyName()
The fields names returned will be entity when the ownerName field is 'null' or combination of entity and ownerName when the ownerName field is not 'null'. This method is used internally by Web NMS.
getKeyName in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationsgetKeyName in interface DBInterfacepublic java.util.Properties getUserProperties()
getUserProperties in interface DBExtendedInterface
public void setUserProperty(java.lang.String nam,
java.lang.String val)
setUserProperty in interface DBExtendedInterfacenam - key for userpropertyval - corresponding value to key as an Objectpublic java.lang.String getUserProperty(java.lang.String nam)
getUserProperty in interface DBExtendedInterfacenam - key for userproperty
public java.lang.Object getDynamicUserProperty(java.lang.String nam)
public void setDynamicUserProperty(java.lang.String key,
java.lang.Object value)
public java.lang.String removeUserProperty(java.lang.String nam)
removeUserProperty in interface DBExtendedInterfacenam - key for userproperty
public com.adventnet.nms.common.corba.Property_CT[] getProperties_CT()
getProperties_CT in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic com.adventnet.nms.common.corba.Property_CT[] getUserProperties_CT()
getUserProperties_CT in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationspublic void setProperties_CT(com.adventnet.nms.common.corba.Property_CT[] property_array)
setProperties_CT in interface com.adventnet.nms.alertdb.corba.Alert_CIOperationsproperty_array - array of com.adventnet.nms.common.corba.Property_CTpublic java.util.Map getMappedProperties()
public void setMappedProperties(java.util.Map mappedProps)
|
"WEBNMS_5 API Docs" | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||