|
"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.eventdb.Event
public class Event
This class represents the events generated within Web NMS. Events are the complete set of notifications from the network and Events in Web NMS represent an important repository of management information within Web NMS. Every happening within the Web NMS system, like Managed Objects discovery, status update, Data collection exceeding Thresholds, processing traps etc., are registered as an Event. For every event reported or generated within Web NMS system, a corresponding instance of this class or its derived class will be created.
They are also involved in Event to Alert Correlation (Alert generation). Events can also be generated by the Users and added to Web NMS using Event API methods.
The Event 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 Event object either by extending the object or using the concept of User Properties.
Often applications do not need to create their own subclasses of Event, since it allows for easily storing custom properties in Event itself. Event 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 event.setUserProperty("userProp","NMS"); and retrieve it using the property by doing a call String nmsString = event.getUserProperty("userProp");
Every Event object generated or added within the Web NMS will be uniquely identified (equivalent to primary key) by an numeric identifier, known as id. This id will be automatically generated by the Web NMS system and the user has no control over its assignment. The ids are continuous positive integers starting from 1.
Users could only add Events and could not modify existing Events. Once the properties of an Event is set and added into the server cannot be modified. Events should be deleted only by Web NMS.
EventAPI,
Serialized Form| Constructor Summary | |
|---|---|
Event()
This is the default Constructor of the Class. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Creates and returns a copy of this object. |
void |
decodeObj(byte[] bytes)
This method sets the properties of the Event object from the byte[] passed as an argument. |
byte[] |
encodeObj()
This method converts all the properties of the Event Object along with their corresponding values into a byte stream and returns the stream as a byte[]. |
java.lang.String |
getCategory()
Accessor method to get the Category of the event. |
java.lang.Object |
getDeviceNotification()
Returns the notification object with which the Event is generated. |
java.lang.String |
getDomain()
Accessor method to get the Domain of the event. |
java.lang.Object |
getDynamicUserProperty(java.lang.String nam)
|
java.lang.String |
getEntity()
Accessor method to get the Entity of the Event. |
java.lang.String |
getGroupName()
Accessor method to get the Group Name to which this event belongs. |
java.lang.String |
getHelpURL()
Accessor method to get the Help URL set for this Event Object. |
int |
getId()
Gets the unique id of this event object. |
java.lang.String |
getKey()
Accessor method to get the key value of this Event. |
java.lang.String |
getKeyName()
Returns the field names used as the unique key of this Event object. |
java.util.Map |
getMappedProperties()
|
java.lang.String |
getNetwork()
Accessor method to get the Network of this event. |
java.lang.String |
getNode()
Accessor method to get the Node field of the Event. |
java.lang.String |
getOwnerName()
Accessor method to get the name of the owner to which the corresponding Event object belongs. |
com.adventnet.nms.common.corba.Property_CT[] |
getProperties_CT()
corba : corba implementation of getProperties() |
java.util.Properties |
getProperties()
This method returns the values of all the fields in this event object as a key,value pair in a java.util.Properties object. |
int |
getSeverity()
Accessor method to Get the Severity of the Event object. |
com.adventnet.snmp.snmp2.SnmpPDU |
getSnmpPDU()
This method will return the Snmp Trap PDU reference associated with this event. |
java.lang.String |
getSource()
Accessor method to get the Source of the event. |
java.lang.String |
getText()
Accessor method to get the descriptive text message of the event. |
long |
getTime()
Accessor method to get the time stamp at which the Event object is generated. |
com.adventnet.nms.common.corba.Property_CT[] |
getUserProperties_CT()
corba: Event_CIOperations interface method |
java.util.Properties |
getUserProperties()
The method returns all the user properties set in this event object as a key,value pair in a java.lang.Properties object. |
java.lang.String |
getUserProperty(java.lang.String nam)
The method returns the value of user property present matching the name passed as argument. |
java.lang.String |
getWebNMS()
Accessor method to Get the WebNMS server that owns this Event Object. |
java.lang.String |
removeUserProperty(java.lang.String nam)
The method removes any user property present in the Event object matching the name passed as an argument and returns the value of the property if it exists, else null is returned. |
void |
setCategory(java.lang.String category)
Modifier method to set the category of the event, like Topology event or Threshold event etc. |
void |
setDeviceNotification(java.lang.Object obj)
This method will set the device notification object reference in Event with which this Event got generated. |
void |
setDomain(java.lang.String domain)
Modifier method to set the Domain of the event. |
void |
setDynamicUserProperty(java.lang.String key,
java.lang.Object value)
|
void |
setEntity(java.lang.String entity)
Modifier method to set the Entity of the Event. |
void |
setGroupName(java.lang.String group)
Modifier method to set the Group Name to which this event belongs. |
void |
setHelpURL(java.lang.String helpURL)
Modifier method to set the Help URL for this Event Object. |
void |
setId(int id)
Sets the unique id of this event object. |
void |
setMappedProperties(java.util.Map mappedProps)
|
void |
setNetwork(java.lang.String network)
Modifier method to set the Network of the event. |
void |
setNode(java.lang.String node)
Modifier method to set the Node field of the Event. |
void |
setOwnerName(java.lang.String owner)
Modifier method to set the owner to which the corresponding Event object belongs. |
void |
setProperties_CT(com.adventnet.nms.common.corba.Property_CT[] properties)
corba : corba implementation of setProperties() |
void |
setProperties(java.util.Properties p)
This method sets the properties of the Event Object. |
void |
setSeverity(int severity)
Modifier method to set the Severity of the Event object. |
void |
setSnmpPDU(com.adventnet.snmp.snmp2.SnmpPDU pdu)
This method will set the Snmp Trap PDU reference that is to be associated with this event. |
void |
setSource(java.lang.String source)
Modifier method to get the Source of the event. |
void |
setText(java.lang.String text)
Modifier method used to set the descriptive text message of the event. |
void |
setTime(long time)
Modifier method to set the time stamp at which the Event object is generated. |
void |
setUserProperty(java.lang.String nam,
java.lang.String val)
This method sets a user property to the Event Object. |
void |
setWebNMS(java.lang.String webNMS)
Modifier method to set the Web NMS server that owns this Event Object. |
java.lang.String |
toLogString()
This method returns a concatenated string, seperated by colon (:) containing the values of all the properties of this Event Object. |
java.lang.String |
toString()
This method overrides the corresponding method in the java.lang.Object class. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Event()
| Method Detail |
|---|
public int getId()
getId in interface com.adventnet.nms.eventdb.corba.Event_CIOperationssetId(int)public void setId(int id)
Note: This method is for internal purpose. Even if the user sets the id for the Event using this method, the id field of the Event will be overridden by Web NMS. Since setting the id field is of no use, the users are suggested not to set id for Event.
setId in interface com.adventnet.nms.eventdb.corba.Event_CIOperationsid - The unique id of this event object.getId()public java.lang.String getText()
getText in interface com.adventnet.nms.eventdb.corba.Event_CIOperationssetText(String)public void setText(java.lang.String text)
setText in interface com.adventnet.nms.eventdb.corba.Event_CIOperationstext - The text string to be set for the Event.getText()public java.lang.String getCategory()
getCategory in interface com.adventnet.nms.eventdb.corba.Event_CIOperationssetCategory(String)public void setCategory(java.lang.String category)
The 'category' field once set and added to the server cannot be modified.
setCategory in interface com.adventnet.nms.eventdb.corba.Event_CIOperationscategory - The category to which this event belongs.getCategory()public void setDeviceNotification(java.lang.Object obj)
This method can be used to hold the notification object if the Event has been constructed through some notification type like Snmp Trap, TL1 Autonomous message, etc. The user should be informed that the notification reference set to this event object will not be stored in persistent storage of Web NMS, and is transient. Hence, when this event is retrieved back from the Data Store, the notification reference within the event object will be 'null'.
obj - - The Object reference with which the Event is generated.public java.lang.Object getDeviceNotification()
SnmpPDU object for SnmpTrap notification or TL1AutonomousMessage
for TL1 notification. Explicit type casting should be done according to the type of Object. This method will return 'null', if the Event is generated by WebNMS status polling and no explicit Object reference is set using setDeviceNotification(Object ).
public java.lang.String getDomain()
The corresponding modifier method present in this class can be used to set the domain of the Event. This method will return 'null' when the 'domain' field is not set.
getDomain in interface com.adventnet.nms.eventdb.corba.Event_CIOperationssetDomain(String)public void setDomain(java.lang.String domain)
setDomain in interface com.adventnet.nms.eventdb.corba.Event_CIOperationsdomain - The domain of this event.getDomain()public java.lang.String getNetwork()
Users could set the Network for the Event generated at the level of Trap Filter, Trap Parsers, Event Parsers and Event Filters. The corresponding modifier method present in this class can be used to set the Network of the Event.
This method will return 'null' when the 'network' field is not set.
getNetwork in interface com.adventnet.nms.eventdb.corba.Event_CIOperationssetNetwork(String)public void setNetwork(java.lang.String network)
Users could also set the Network for the Event generated even at the level of Trap Filter, Trap Parsers, Event Parsers and Event Filters. The 'network' field once set added to the server cannot be modified.
setNetwork in interface com.adventnet.nms.eventdb.corba.Event_CIOperationsnetwork - The Network information of this event.getNetwork()public java.lang.String getNode()
Users could set the Node for the Event generated at the level of Trap Filters, Trap Parsers, Event Parsers and Event Filters. The corresponding modifier method present in this class can be used to modify or set the Node field.
This method will return 'null' when the 'node' field is not set.
getNode in interface com.adventnet.nms.eventdb.corba.Event_CIOperationssetNode(String)public void setNode(java.lang.String node)
Users could set the Node for the Event generated, at the level of Trap Filters, Trap Parsers, Event Parsers and Event Filters. The 'node' field once set and added to the server cannot be modified.
setNode in interface com.adventnet.nms.eventdb.corba.Event_CIOperationsnode - The Node string that has to be set for the Event.getNode()public java.lang.String getEntity()
This is a key field, based on which Event Correlation into Alerts is achieved in Web NMS. All Events with the same Entity will result in only one Alert (i.e. entity is the primary key for an Alert Object).
They could use the corresponding modifier method present to set the entity field of an Event.
For events that are generated during discovery and status polling by Web NMS, this field holds the key of the Managed Object for which this event has been generated.
This method will return 'null' if the 'entity' field is not set. 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 Events 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 Events 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.eventdb.corba.Event_CIOperationssetEntity(String)public void setEntity(java.lang.String entity)
This field is the key, based on which Event Correlation into Alerts is achieved in Web NMS. All Events with the same Entity will result in only one Alert (i.e. entity is the primary key for an Alert Object). For events that are generated during discovery and status polling by Web NMS, this field holds the key of the Managed Object for which this event has been generated.
Users could set the Entity of the Event generated at the level of Trap Filters, Trap Parsers, Event Parsers and Event Filters.
The 'entity' field once set and added to the server cannot be modified.
setEntity in interface com.adventnet.nms.eventdb.corba.Event_CIOperationsentity - The entity to be set for the Event generated.#getEntity(String)public int getSeverity()
By default, SpecialPurposeSeverity severity defined in the SeverityInfo.conf file will be set as the value of this field. The user could set the severity of the Event at the level of Trap Parser, Trap Filter, Event Parser and Event Filter. The corresponding modifier method present in this class can be used to set or modify the severity.
getSeverity in interface com.adventnet.nms.eventdb.corba.Event_CIOperationssetSeverity(int)public void setSeverity(int severity)
By default SpecialPurposeSeverity defined in the SeverityInfo.conf file will be set as the value of this field. The user could set the severity of the Event at the level of Trap Parser, Trap Filter, Event Parser and Event Filter. If an invalid severity value is passed to the method, then the severity will be set to Info.
setSeverity in interface com.adventnet.nms.eventdb.corba.Event_CIOperationsseverity - The integer value corresponding to the Severity to be set
for the Event. If the severity value passed is invalid, then
Info severity will be set to the Event.getSeverity()public long getTime()
getTime in interface com.adventnet.nms.eventdb.corba.Event_CIOperationssetTime(long)public void setTime(long time)
setTime in interface com.adventnet.nms.eventdb.corba.Event_CIOperationstime - The time value in milliseconds, to be set for the Event Object.getTime()public java.lang.String getSource()
Users could use the corresponding modifier method present in this class to set the source of the Event. 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 Events 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 Events 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.
getSource in interface com.adventnet.nms.eventdb.corba.Event_CIOperationssetSource(String)public void setSource(java.lang.String source)
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.
setSource in interface com.adventnet.nms.eventdb.corba.Event_CIOperationssource - The source of the event.getSource()public java.lang.String getHelpURL()
In Java client on viewing the Event details, when the user clicks the Help button, this is the file that will be displayed as help to the Event object. The users could modify or set the help URL using the corresponding modifier method present in this class. This method will return 'null' when the 'helpURL' field is not set.
getHelpURL in interface com.adventnet.nms.eventdb.corba.Event_CIOperationssetHelpURL(String)public void setHelpURL(java.lang.String helpURL)
In Java client on viewing the Event details, when the users click the Help button, this is the file that will be displayed as help to the Event object. The 'helpURL' field once set and added to the server cannot be modified.
setHelpURL in interface com.adventnet.nms.eventdb.corba.Event_CIOperationshelpURL - The help file path relative to the WebNMS/help directory
should be passed.getHelpURL()public java.lang.String getWebNMS()
getWebNMS in interface com.adventnet.nms.eventdb.corba.Event_CIOperationssetWebNMS(String)public void setWebNMS(java.lang.String webNMS)
setWebNMS in interface com.adventnet.nms.eventdb.corba.Event_CIOperationswebNMS - The Web NMS server name that owns this Event Object.getWebNMS()public java.lang.String getGroupName()
Alerts with same 'groupName' field will be grouped while displaying Alerts 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.eventdb.corba.Event_CIOperationssetGroupName(String)public void setGroupName(java.lang.String group)
setGroupName in interface com.adventnet.nms.eventdb.corba.Event_CIOperationsgroup - The group name to be set for this Event object.getGroupName()public 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 Event belongs.public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toLogString()
:+id+:+severity+:+time+:+source+:+helpURL+:+category+:+domain+:+network+:+node+:+entity
+:+text+:+groupName+[:+userproperty+:+userproperty....]+NEW_LINE_CHARACTER
toLogString in interface com.adventnet.nms.eventdb.corba.Event_CIOperationspublic 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 MyEvent extends Event
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 Event properties.id, severity, time, text, category, domain, network, node, entity, source, helpURL, groupName, webNMS, stringseverity, ownerName 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)
The user should note that the values passed for the properties severity and time should be numerically convertible. If not, this method will not provide expected result. The user should also take care that the value set for the severity field is a valid severity defined in the Web NMS system, if not then Info severity will be set to the Event object. When 'null' is passed as argument the method returns without any function being performed.
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 MyEvent extends
Event and has a field String myfield = "";
In the setProperties() method (of class MyEvent) 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 event 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 Event Object. The key value should either exactly
match the name of any standard property field in the Event Object or it will be considered
as a User property to be set for the Event Object.
The following are the keys to be used in the argument Properties object, for the corresponding property of the Event.
id, severity, time, text, category, domain, network, node,
entity, source, helpURL, groupName, webNMS, stringseverity, ownerName
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 setUserProperty(java.lang.String nam,
java.lang.String val)
The user should note that there could be only one user property with the same name. When the user tries to set the same user property repeatedly, then only the existing user property with the same name will be overridden. Users are strongly recommended not to set a user property with the same name as any of the standard property name of the Event object, as it would cause some unpredictable effect while Web NMS handles this Event Object.
setUserProperty in interface DBExtendedInterfacenam - The name of the User property to be added. It should not be
matching the name of any of the standard property of the Event Object. The user
should take care that it is not null, else the user property will
not be added.val - The corresponding value(as an Object) of the User property.
The user should take care that this value is not null,
else the user property will be not be added.getUserProperty(String),
removeUserProperty(String)public java.lang.String getUserProperty(java.lang.String nam)
getUserProperty in interface DBExtendedInterfacenam - The name of the user property in the event object for which the value has to be
returned by this method.
#setUserProperty(String,Object),
removeUserProperty(String)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 - The name of the user property that has to be removed from the
Event object.
getUserProperty(String),
#setUserProperty(String,Object)public java.util.Properties getUserProperties()
getUserProperties in interface DBExtendedInterfacepublic byte[] encodeObj()
Users could use this method in combination with the decodeObj(byte[]) method present in this class to achieve an effective serialization - deserialization mechanism of the Event object.
decodeObj(byte[])
public void decodeObj(byte[] bytes)
throws java.io.IOException
Users could use this method in combination with the encodeObj() method present in this class to achieve an effective serialization - deserialization mechanism of the Event object.
bytes - The byte[] containing the properties along with their values
to be set to the Event Object. The byte[] should be in the same format
as returned by the encodeObj() method present in this class.
java.io.IOExceptionencodeObj()public java.lang.String getKey()
Since the key field could be either id when ownerName field is 'null' and combination of id and ownerName when ownerName field is not 'null', users are suggested to use this method to get the key value for an Event.
getKey in interface com.adventnet.nms.eventdb.corba.Event_CIOperationsgetKey in interface DBInterfacepublic java.lang.String getKeyName()
The fields names returned will be id when the ownerName field is 'null' or combination of id and ownerName when the ownerName field is not 'null'. This method is used internally by Web NMS.
getKeyName in interface com.adventnet.nms.eventdb.corba.Event_CIOperationsgetKeyName in interface DBInterfacepublic com.adventnet.nms.common.corba.Property_CT[] getProperties_CT()
getProperties_CT in interface com.adventnet.nms.eventdb.corba.Event_CIOperationspublic void setProperties_CT(com.adventnet.nms.common.corba.Property_CT[] properties)
setProperties_CT in interface com.adventnet.nms.eventdb.corba.Event_CIOperationsproperties - which is to be set to Event Object.public com.adventnet.nms.common.corba.Property_CT[] getUserProperties_CT()
getUserProperties_CT in interface com.adventnet.nms.eventdb.corba.Event_CIOperationspublic com.adventnet.snmp.snmp2.SnmpPDU getSnmpPDU()
The returned reference will be 'null' when the event has not been generated through a Trap or when the TRANSIENT_TRAP_PDU_IN_EVENT parameter against EventMgr process, in the configuration file NmsProcessesBE.conf is set to false.
The user should be informed that the trap pdu reference set to this event object will not be stored in persistent storage of Web NMS, and is transient. Hence, when this event is retrieved back from the Data Store or using the Event API calls, the trap pdu reference within the event object will be 'null'. The transient reference could be used at the level of Event parsers and Event filters to access the properties of the Snmp Pdu with which this Event has been generated.
setSnmpPDU(SnmpPDU)public void setSnmpPDU(com.adventnet.snmp.snmp2.SnmpPDU pdu)
This method will be internally used by Web NMS to have the trap pdu associated with the event object created by it (the trap). This trap reference could be used at the level of Event Parsers and Event Filters to access the properties of the corresponding trap with which this event has been generated.
The user should be informed that the trap pdu set to this event object will not be stored in persistent storage of Web NMS, and is transient. Hence, when the same event is retrieved back from the Data Store using the Event API calls, the trap pdu reference within the event object will be 'null'.
pdu - The com.adventnet.snmp.snmp2.SnmpPDU to be associated with this event object.getSnmpPDU()public 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 | ||||||||