"WEBNMS_5 API Docs"

com.adventnet.nms.mapui
Class MapSubscriber

java.lang.Object
  extended by com.adventnet.nms.mapui.MapSubscriber
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.TreeModelListener

public class MapSubscriber
extends java.lang.Object
implements javax.swing.event.TreeModelListener

This class can be used to receive updates from the server for map objects. This class implements javax.swing.event.TreeModelListener to receive updates.

This class contains instance of com.adventnet.nms.mapui.DefaultMapModel for having map objects, and also this class contains an instance of com.adventnet.nms.topodb.DefaultTopoSubscriber which takes care of receiving updates from the server.

See Also:
DefaultTopoSubscriber, NmsTreeNode

Constructor Summary
MapSubscriber(java.lang.String objName, java.lang.String hostName)
          This constructor takes care of creating map model for the objName and register itself for receiving the updates.
 
Method Summary
protected  void createMapLink(MapSymbolComponent source, MapSymbolComponent dest)
          This is used to create a map link with the specified source and destination objects.
protected  MapSymbolComponent createMapObject(ManagedObject mobj)
          This method can be used to create a map object (MapSymbolComponent or MapContainerComponent) for the managed object.
protected  void deleteMapObject(ManagedObject mobj)
          This method can be used to delete a map object (MapSymbolComponent or MapContainerComponent) for the managed object.
 void treeNodesChanged(javax.swing.event.TreeModelEvent evt)
          This method will be invoked when nodes are updated in the tree.
 void treeNodesInserted(javax.swing.event.TreeModelEvent evt)
          This method will be invoked when nodes are inserted in the tree.
 void treeNodesRemoved(javax.swing.event.TreeModelEvent evt)
          This method will be invoked when nodes are removed from the tree.
 void treeStructureChanged(javax.swing.event.TreeModelEvent evt)
          This method will be invoked when there is entire change in structure of tree.
 void unsubscribe()
          This method can be used to deregister the topo subscriber to stop getting the updates.
protected  void updateMapObject(ManagedObject mobj)
          This method can be used to update a map object (MapSymbolComponent or MapContainerComponent) for the managed object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapSubscriber

public MapSubscriber(java.lang.String objName,
                     java.lang.String hostName)
This constructor takes care of creating map model for the objName and register itself for receiving the updates.

Parameters:
objName - object name for which the map to be created.
hostName - host name where the server is running.
Method Detail

createMapObject

protected MapSymbolComponent createMapObject(ManagedObject mobj)
This method can be used to create a map object (MapSymbolComponent or MapContainerComponent) for the managed object. Every tree node holds a managed object as a user object. For every managed object there will be a corresponding map object. This method can be overridden in the child classes to add additional properties for the map object etc.

If the managed object is instance of com.adventnet.nms.topodb.ContainerInterface this will create a instance com.adventnet.nms.mapui.MapContainerComponent or this will create an instance of com.adventnet.nms.mapui.MapSymbolComponent.

Parameters:
mobj - instance of ManagedObject for which the map object to be created.
Returns:
map object for the corresponding managed object.

deleteMapObject

protected void deleteMapObject(ManagedObject mobj)
This method can be used to delete a map object (MapSymbolComponent or MapContainerComponent) for the managed object.

Parameters:
mobj - instance of ManagedObject for which the map object to be deleted.

updateMapObject

protected void updateMapObject(ManagedObject mobj)
This method can be used to update a map object (MapSymbolComponent or MapContainerComponent) for the managed object.

Parameters:
mobj - instance of ManagedObject for which the map object ot be deleted.

createMapLink

protected void createMapLink(MapSymbolComponent source,
                             MapSymbolComponent dest)
This is used to create a map link with the specified source and destination objects. The new map link will be added ih the source object.

Parameters:
source - source map object. This must be an instance of MapContainerComponent.
dest - destination object. This can be an instance of MapContainerComponent or MapSymbolComponent.

treeNodesInserted

public void treeNodesInserted(javax.swing.event.TreeModelEvent evt)
This method will be invoked when nodes are inserted in the tree.

Specified by:
treeNodesInserted in interface javax.swing.event.TreeModelListener
See Also:
TreeModelEvent

treeNodesRemoved

public void treeNodesRemoved(javax.swing.event.TreeModelEvent evt)
This method will be invoked when nodes are removed from the tree.

Specified by:
treeNodesRemoved in interface javax.swing.event.TreeModelListener
See Also:
TreeModelEvent

treeNodesChanged

public void treeNodesChanged(javax.swing.event.TreeModelEvent evt)
This method will be invoked when nodes are updated in the tree.

Specified by:
treeNodesChanged in interface javax.swing.event.TreeModelListener
See Also:
TreeModelEvent

treeStructureChanged

public void treeStructureChanged(javax.swing.event.TreeModelEvent evt)
This method will be invoked when there is entire change in structure of tree.

Specified by:
treeStructureChanged in interface javax.swing.event.TreeModelListener
See Also:
TreeModelEvent

unsubscribe

public void unsubscribe()
                 throws java.rmi.RemoteException
This method can be used to deregister the topo subscriber to stop getting the updates.

Throws:
java.rmi.RemoteException

"WEBNMS_5 API Docs"

Copyright © 2011 ZOHO Corp., All Rights Reserved.