medisyn
Class ScenarioNodeMgr

java.lang.Object
  extended by medisyn.ScenarioNodeMgr

public class ScenarioNodeMgr
extends java.lang.Object

Manages all nodes taking part in a scenario

Author:
Leo Bosnjak

Field Summary
private  java.util.Vector<X2XProxy> nodes
           
 
Constructor Summary
ScenarioNodeMgr()
          construct a ScenarioNodeMgr with some statically added nodes
 
Method Summary
 void addNode(X2XProxy node)
          adds a node into node-vector
 void deleteAllNodes()
          deletes all nodes from scenario
 void deleteNode(X2XProxy node)
          deletes a node frome node-vector
 X2XProxy findNode(int[] ip)
          Finds the proxy with the given ip in all nodes
 X2XProxy findNode(java.lang.String hostName)
          Tries to find the X2XProxy which has the given hostname.
static X2XProxy findNode(java.util.Vector<X2XProxy> proxies, int[] ip)
          Finds the proxy with the given ip
 java.util.Vector<X2XProxy> getNodes()
           
 void reorderNodes()
          changes the order of the nodes in the vector to a random one
 void setNodes(java.util.Vector<X2XProxy> nodes)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodes

private java.util.Vector<X2XProxy> nodes
Constructor Detail

ScenarioNodeMgr

public ScenarioNodeMgr()
construct a ScenarioNodeMgr with some statically added nodes

Method Detail

getNodes

public java.util.Vector<X2XProxy> getNodes()
Returns:
the nodes

reorderNodes

public void reorderNodes()
changes the order of the nodes in the vector to a random one


setNodes

public void setNodes(java.util.Vector<X2XProxy> nodes)
Parameters:
nodes - the nodes to set

addNode

public void addNode(X2XProxy node)
adds a node into node-vector

Parameters:
node - - node to add

deleteNode

public void deleteNode(X2XProxy node)
deletes a node frome node-vector

Parameters:
node - - node to delete

deleteAllNodes

public void deleteAllNodes()
deletes all nodes from scenario


findNode

public X2XProxy findNode(java.lang.String hostName)
Tries to find the X2XProxy which has the given hostname.

Parameters:
hostName -
Returns:
the X2XProxy with the given name, if it can be found, null otherwise.

findNode

public X2XProxy findNode(int[] ip)
Finds the proxy with the given ip in all nodes

Parameters:
ip - - the ip which shall be found
Returns:
the proxy that has the given ip, null if no proxiy has it.

findNode

public static X2XProxy findNode(java.util.Vector<X2XProxy> proxies,
                                int[] ip)
Finds the proxy with the given ip

Parameters:
proxies - - the vector of proxies to search in
ip - - the ip which shall be found
Returns:
the proxy that has the given ip, null if no proxiy has it.