AdventNet Web NMS 4 API Specification

com.adventnet.nms.topodb
Class TopoNotificationEvent

java.lang.Object
  |
  +--com.adventnet.nms.topodb.TopoNotificationEvent
All Implemented Interfaces:
java.io.Serializable

public class TopoNotificationEvent
extends java.lang.Object
implements java.io.Serializable

This Event is used to propagate the data to the topo action listeners. This will contain the details that has been received from the Topology module about the notification. This event is then propagated to all the action listeners who have registered themselves for responses for any change in the Topology Database. These action listeners should either implement the TopoActionListener interface or extend the AbstractTopoActionListener class.

See Also:
Serialized Form

Constructor Summary
TopoNotificationEvent(java.lang.String type, java.util.Vector objects)
          Constructs a TopoNotificationEvent.
 
Method Summary
 java.util.Vector getModifiedPropertyKeys()
          Returns the Vector of keys that were modified on updating the ManagedObject.
 ManagedObject getNewManagedObject()
          Returns the ManagedObject instance that was added or modified, causing this nofitication.
 ManagedObject getOldManagedObject()
          Returns the ManagedObject instance that was before the database change, causing this nofitication.
 java.lang.String getUpdateType()
          Returns the type of the database change occurred.
 java.lang.String toString()
          Returns a string representation of this Event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TopoNotificationEvent

public TopoNotificationEvent(java.lang.String type,
                             java.util.Vector objects)
Constructs a TopoNotificationEvent.
Parameters:
type - - Type of the database change ocurred.
objects - - a vector containing both the new ManagedObject and the old ManagedObject
Method Detail

getUpdateType

public java.lang.String getUpdateType()
Returns the type of the database change occurred. The type can be one of the following :
 type		           Details
 

"Added" Implies that a new ManagedObject has been added to the Topology Database.

"Deleted" Implies that a ManagedObject has been deleted from the database.

"Manage Update" Impiles that the managed property of the ManagedObject has changed from its previous value. This happens when a managed object is managed / unmanaged using API methods or from the client or when its status changes to unknown.

"Status Update" Impiles that the status property of the ManagedObject has been modified. This occurs during the status polling, rediscovery or when status is updated explicitly (using the API methods or from client).

"StatusPollEnabled Update" Impiles that the statusPollEnabled property of the ManagedObject has changed from its previous value.

"Discover Update" Impiles that the discover property of the Network Object has changed from its previous value. This property is modified when the network is managed from unmanaged state and also using the API methods.

"Property Update" Implies that some other property (including user properties) of the ManagedObject, other than managed, status, discover and statusPollEnabled properties, has changed.

"IpAddress Update" Implies that the ipAddress property of the Managed Object has changed.

"License Limit Exceeded" Implies that the number of the ManagedObjects/Devices has exceeded the limit specified in the License file and hence will not be added to the database.Information regarding the type of license (Whether MO_based or Device_based) is set as a property named "license_type" and information on license limit is set as a property named "license_limit" for the ManagedObject for which the notification is received. e.g.: Let the Applied license have a limit of 200 Managed Objects.After adding 200 ManagedObject to the database,if some more ManagedObject is being added then the Listener will get notified and those ManagedObjects will not get added to the Database. In the update(TopoNotificationEvent evt) method evt.getUpdateType() will return the string License Limit Exceed . The information regarding the license type and limit can be got as follows inside the update() method //code snippet ManagedObject obj=evt.getNewManagedObject(); Properties prop=obj.getProperties(); //The below line returns the String "MO_based" String licenseType=prop.getProperty("license_type"); //The below line returns the String "200" String licenseLimit=prop.getProperty("license_limit");

Returns:
type String, identifying the type of database change.

getOldManagedObject

public ManagedObject getOldManagedObject()
Returns the ManagedObject instance that was before the database change, causing this nofitication. Note that the ManagedObject instance passed to this method will not have the changes made. But, if the notification is received with type "Status Update", "Manage Update", "Discover Update", "Property update", user can get the modified property keys using the method getModifiedPropertyKeys(). On receiving the type as "Added" this method will return null, since there exists no ManagedObject on this name before the operation.
Returns:
ManagedObject, that was before the update.

getNewManagedObject

public ManagedObject getNewManagedObject()
Returns the ManagedObject instance that was added or modified, causing this nofitication. Note that the ManagedObject instance passed to this method will have the changes made. But, if the notification is received with type "Status Update", "Manage Update", "Discover Update", "Property update" user can get the modified property keys using the method getModifiedPropertyKeys(). On receiving the type as "Deleted" this method will return null, since there exists no ManagedObject with this name after the operation.
Returns:
ManagedObject, that underwent update.

getModifiedPropertyKeys

public java.util.Vector getModifiedPropertyKeys()
Returns the Vector of keys that were modified on updating the ManagedObject. This will return all the properties that were modified including the user properties also. For the notification type "Added", this will return all the property names of the newly added ManagedObject. For the notification type "Deleted", this will return all the property names of the deleted ManagedObject.
Returns:
Vector, of all the property keys that were modified.

toString

public java.lang.String toString()
Returns a string representation of this Event. This returns the string containing the type of the database change with the name of the ManagedObject that underwent change.
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this event.

AdventNet Web NMS 4 API Specification