|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcgl.narada.topology.viewer.Node
public class Node
This class represents a node(broker node) in the system. It stores and operates on all the information required for a node.
| Field Summary | |
|---|---|
List |
clients
|
static int |
INVALID_VALUE
|
int |
nodeId
|
Position |
nodeLocation
|
int |
parentClusterId
|
int |
parentSClusterId
|
int |
parentSSClusterId
|
| Constructor Summary | |
|---|---|
Node()
Empty Constructor. |
|
Node(int nodeId,
int pClusterId,
int pSClusterId,
int pSSClusterId)
Constructor, initializes the components constituting the node Address |
|
| Method Summary | |
|---|---|
void |
addClient(int clientId,
String clientType)
Adds a client to the broker node. |
void |
addTopic(int clientId,
String topic)
Adds a topic requested by the specified client to the broker node. |
boolean |
canFitOnPanel(int limitX1,
int limitY1,
int limitX2,
int limitY2)
Depending upon the location of the node and screen limits, returns true if whole or part of the node is visible on the screen otherwise returns false. |
void |
deleteAllClients()
Deletes all the clients associated with this broker node. |
void |
deleteAllTopics(int clientId)
Deletes all the topics requested by a specified client. |
void |
deleteClient(int clientId)
Deletes the specified client associated with the broker node. |
void |
deleteTopic(int clientId,
String topic)
Deletes the specified topic from the specified client associated with the broker node. |
void |
drawNode(Graphics g,
int limitX1,
int limitY1,
int limitX2,
int limitY2)
Draws a filled circle representing this node on the screen. |
List |
getAllClients()
Gets all the Subscription objects associated with all the
clients for this node. |
Subscription |
getClient(int clientId)
Gets a Subscription object corresponding to the specified
client id. |
String |
getNodeAddress()
Returns String representation of node address
(eg. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int INVALID_VALUE
public int nodeId
public int parentClusterId
public int parentSClusterId
public int parentSSClusterId
public List clients
public Position nodeLocation
| Constructor Detail |
|---|
public Node()
public Node(int nodeId,
int pClusterId,
int pSClusterId,
int pSSClusterId)
nodeId - id of a node.pClusterId - id of a cluster containg the node.pSClusterId - id of a super cluster containg the node.pSSClusterId - id of a super super cluster containg the node.| Method Detail |
|---|
public boolean canFitOnPanel(int limitX1,
int limitY1,
int limitX2,
int limitY2)
limitX1 - lower limit for X-coordinatelimitY1 - lower limit for Y-coordinatelimitX2 - upper limit for X-coordinatelimitY2 - upper limit for Y-coordinate
public void drawNode(Graphics g,
int limitX1,
int limitY1,
int limitX2,
int limitY2)
nodeLocation object.
g - Graphics object for image drawing.limitX1 - lower limit for X-coordinatelimitY1 - lower limit for Y-coordinatelimitX2 - upper limit for X-coordinatelimitY2 - upper limit for Y-coordinatepublic Subscription getClient(int clientId)
Subscription object corresponding to the specified
client id.
clientId - id of a client
Subscription object associated with the client id.public List getAllClients()
Subscription objects associated with all the
clients for this node.
List of Subscription objects.
public void addClient(int clientId,
String clientType)
clientId - id of a client.clientType - type of a client.
public void addTopic(int clientId,
String topic)
throws TopologyException
clientId - id of a client for which topic needs to be added.topic - String representation of the topic to be added
TopologyException
public void deleteTopic(int clientId,
String topic)
throws TopologyException
clientId - id of the client whose topic is being deleted.topic - to be deleted.
TopologyException - if the specified client is not found with this
broker node.
public void deleteAllTopics(int clientId)
throws TopologyException
clientId - id of a client whose topics are being deleted.
TopologyException - if the specified client is not found with this
broker node.
public void deleteClient(int clientId)
throws TopologyException
clientId - id of a client being deleted.
TopologyException - if the specified client is not found.public void deleteAllClients()
public String getNodeAddress()
String representation of node address
(eg. 1.2.3.4)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||