rice.pastry.direct
Interface NetworkSimulator

All Known Implementing Classes:
EuclideanNetwork, SphereNetwork

public interface NetworkSimulator

Interface to an object which is simulating the network.


Method Summary
 void deliverMessage(Message msg, PastryNode node)
          Deliver message.
 DirectNodeHandle getClosest(NodeId nid)
           
 TestRecord getTestRecord()
           
 boolean isAlive(NodeId nid)
          Checks to see if a node id is alive.
 int proximity(NodeId a, NodeId b)
          Determines proximity between two nodes.
 void registerNodeId(DirectNodeHandle nh)
          Registers a node handle with the simulator.
 void setAlive(NodeId nid, boolean alive)
           
 void setTestRecord(TestRecord tr)
           
 boolean simulate()
          Simulate one message delivery.
 

Method Detail

registerNodeId

public void registerNodeId(DirectNodeHandle nh)
Registers a node handle with the simulator.

Parameters:
nh - the node handle to register.

isAlive

public boolean isAlive(NodeId nid)
Checks to see if a node id is alive.

Parameters:
nid - a node id.
Returns:
true if alive, false otherwise.

proximity

public int proximity(NodeId a,
                     NodeId b)
Determines proximity between two nodes.

Parameters:
a - a node id.
b - another node id.
Returns:
proximity of b to a.

deliverMessage

public void deliverMessage(Message msg,
                           PastryNode node)
Deliver message.

Parameters:
msg - message to deliver.
node - the Pastry node to deliver it to.

simulate

public boolean simulate()
Simulate one message delivery.

Returns:
true if a message was delivered, false otherwise.

setTestRecord

public void setTestRecord(TestRecord tr)

getTestRecord

public TestRecord getTestRecord()

getClosest

public DirectNodeHandle getClosest(NodeId nid)

setAlive

public void setAlive(NodeId nid,
                     boolean alive)





Imprint-Dataprotection