"WEBNMS_5 API Docs"

com.adventnet.nms.topodb
Interface TopoSubscriber

All Superinterfaces:
java.rmi.Remote
All Known Implementing Classes:
DefaultTopoSubscriber

public interface TopoSubscriber
extends java.rmi.Remote

This is the interface that needs to be implemented for getting notifications of add, delete, update of related objects in the Topology Database. The relation being referred to here, is the containment relationship or parent-child relationship. To listen for notifications about the container object and its children, users should implement this interface and register the container object with the Topology module using the TopoAPI.registerTopoSubscriber(TopoSubscriber, String) method. Hence, by implementing TopoSubscriber, notifications for parent and its children can only be obtained unlike TopoObserver where notifications for all objects in the Topology DataBase can be obtained. If you no longer want to receive notification about the changes in the Topology DataBase, you can deregister from getting notifications using TopoAPI.deregisterTopoSubscriber(TopoSubscriber) method. The class implementing the interface can listen for notifications through RMI too.

To use RMI, get the TopoAPI reference through RMI and register with the TopoDB. The Object registering also has to export itself by invoking the java.rmi.server.UnicastRemoteObject.exportObject(); if it is not an instance of a class that extends UnicastRemoteObject.

See Also:
DefaultTopoSubscriber, com.adventnet.nms.topodb.TopoObserver, TopoNotificationRegistry

Method Summary
 void initialize(NmsTreeNode rootNode)
          Deprecated. From Web NMS 5
 void update(java.lang.String type, ManagedObject obj, java.lang.String[] path)
          This method is invoked when a notification is sent from the TopoDB.
 

Method Detail

initialize

void initialize(NmsTreeNode rootNode)
                throws java.rmi.RemoteException
Deprecated. From Web NMS 5

This method is invoked immediately after the container object is registered with topoDB using the method registerTopoSubscriber(). This method will be invoked only once for a TopoSubscriber instance.

Parameters:
rootNode - This root node contains all the child nodes in the form of tree with the parent-children relationship. This method fetches all the children objects of the registered object ( including children of the registered object's children, if any and so on ) recursively, and forms a tree node with the parent-children relationship.
Throws:
java.rmi.RemoteException - in case of error.
See Also:
NmsTreeNode

update

void update(java.lang.String type,
            ManagedObject obj,
            java.lang.String[] path)
            throws java.rmi.RemoteException
This method is invoked when a notification is sent from the TopoDB. This is the method where the user can do the processing related to the object, for which the notification is received. Note that the ManagedObject instance passed to this method will have the change made. Hence, the user can carry out the necessary operation based on the type of notification and the object for which it was received.

Parameters:
type - The type argument is same as the type argument in the method update() of class TopoObserver. Please refer to TopoObserver#update(String,ManagedObject)
obj - The object which received the update.
path - The path of the object which gets update. The path contains the parent object names from the root object including the object name which gets update. The first element of the array being the registered Container Object name and the last element being the name of object which gets update.
Throws:
java.rmi.RemoteException - in case of error.

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.