cgl.narada.topology.viewer
Class VirtualNode

java.lang.Object
  extended by cgl.narada.topology.viewer.Node
      extended by cgl.narada.topology.viewer.VirtualNode

public class VirtualNode
extends Node

This class represents a virtual node (BIG Broker node) which consists of all super super clusetrs. This virtual node is a BIG invisible circle on the screen which contains all types of nodes and information. It separated node management system from the main tree.


Field Summary
 List superSuperClusters
           
 
Fields inherited from class cgl.narada.topology.viewer.Node
clients, INVALID_VALUE, nodeId, nodeLocation, parentClusterId, parentSClusterId, parentSSClusterId
 
Constructor Summary
VirtualNode()
          Only constructor.
 
Method Summary
 void deleteAllSuperSuperClusters(List nodesToBeDeleted)
          Deletes all the super super clusters present in the system cluster.
 void deleteSuperSuperCluster(int superSuperClusterId, int superClusterId, int clusterId, int nodeId, List nodesToBeDeleted)
          Deletes an existing super super cluster inside the virtual node.
 void drawVirtualNode(Graphics g, int limitX1, int limitY1, int limitX2, int limitY2)
          Draws the virtual node only if its part is visible on the screen.
 String getAllCounts()
          Returns a String containing information about counts of individual components.
 Node getNodeAtParticularCoordinates(int x, int y)
          Finds out super super cluster nearest to the specified coordinates.
 Node getParticularNode(int superSuperClusterId, int superClusterId, int clusterId, int nodeId)
          Returns a node in the system with specified super super cluster, super cluster, cluster and node id.
 void insertSuperSuperCluster(int superSuperClusterId, int superClusterId, int clusterId, int nodeId)
          Add a new super super cluster to the list.
 void repositionSuperSuperClusters()
          Gets the new Position objects and assign then to all the super super clusters inside the system.
 
Methods inherited from class cgl.narada.topology.viewer.Node
addClient, addTopic, canFitOnPanel, deleteAllClients, deleteAllTopics, deleteClient, deleteTopic, drawNode, getAllClients, getClient, getNodeAddress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

superSuperClusters

public List superSuperClusters
Constructor Detail

VirtualNode

public VirtualNode()
Only constructor.

Method Detail

insertSuperSuperCluster

public void insertSuperSuperCluster(int superSuperClusterId,
                                    int superClusterId,
                                    int clusterId,
                                    int nodeId)
                             throws TopologyException
Add a new super super cluster to the list. Depending upon the total number of super super clusters in the list, decide the new positions for each of the super super cluster.

Parameters:
superSuperClusterId - id of a super super cluster.
superClusterId - id of a super cluster.
clusterId - id of a cluster.
nodeId - id of a node.
Throws:
TopologyException - if due to some problem. super super cluster is found null during insertion of a node

deleteSuperSuperCluster

public void deleteSuperSuperCluster(int superSuperClusterId,
                                    int superClusterId,
                                    int clusterId,
                                    int nodeId,
                                    List nodesToBeDeleted)
                             throws TopologyException
Deletes an existing super super cluster inside the virtual node. Repositions all other nodes reculrsively.

Parameters:
superSuperClusterId - id of a super super cluster.
superClusterId - id of a super cluster.
clusterId - id of a cluster.
nodeId - id of a node.
nodesToBeDeleted - a List which will contain node addresses of the nodes being deleted.
Throws:
TopologyException - if no such super super cluster id found while node deletion.

deleteAllSuperSuperClusters

public void deleteAllSuperSuperClusters(List nodesToBeDeleted)
Deletes all the super super clusters present in the system cluster.

Parameters:
nodesToBeDeleted - a List which will contain node addresses of the nodes being deleted.

getNodeAtParticularCoordinates

public Node getNodeAtParticularCoordinates(int x,
                                           int y)
Finds out super super cluster nearest to the specified coordinates. Then passes control to the super super cluster for finding a nearest super cluster.

Parameters:
x - X-coordinate
y - Y-coordinate
Returns:
Node nearest to specified coordinates.

drawVirtualNode

public void drawVirtualNode(Graphics g,
                            int limitX1,
                            int limitY1,
                            int limitX2,
                            int limitY2)
Draws the virtual node only if its part is visible on the screen. Draws all the super super clusters inside it.

Parameters:
g - Graphics object for image drawing.
limitX1 - lower limit for X-coordinate
limitY1 - lower limit for Y-coordinate
limitX2 - upper limit for X-coordinate
limitY2 - upper limit for Y-coordinate

getAllCounts

public String getAllCounts()
Returns a String containing information about counts of individual components.


getParticularNode

public Node getParticularNode(int superSuperClusterId,
                              int superClusterId,
                              int clusterId,
                              int nodeId)
Returns a node in the system with specified super super cluster, super cluster, cluster and node id.

Parameters:
superSuperClusterId - id of a super super cluster.
superClusterId - id of a super cluster.
clusterId - id of a cluster.
nodeId - id of a node.
Returns:
Node

repositionSuperSuperClusters

public void repositionSuperSuperClusters()
Gets the new Position objects and assign then to all the super super clusters inside the system. Recurdively calls repositionNodes() for each of the super super cluster.



For comments and suggestions please send e-mail to The NaradaBrokering Project