Rice Pastry API

rice.pastry.direct
Interface NetworkSimulator

All Known Implementing Classes:
EuclideanNetwork, SphereNetwork

public interface NetworkSimulator

Interface to an object which is simulating the network.

Version:
$Id: NetworkSimulator.java,v 1.8 2005/06/09 16:22:01 jeffh Exp $
Author:
Andrew Ladd

Method Summary
 void deliverMessage(Message msg, PastryNode node)
          Deliver message.
 DirectNodeHandle getClosest(NodeId nid)
          Gets the Closest attribute of the NetworkSimulator object
 TestRecord getTestRecord()
          Gets the TestRecord attribute of the NetworkSimulator object
 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)
          Sets the Alive attribute of the NetworkSimulator object
 void setTestRecord(TestRecord tr)
          Sets the TestRecord attribute of the NetworkSimulator object
 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)
Sets the TestRecord attribute of the NetworkSimulator object

Parameters:
tr - The new TestRecord value

getTestRecord

public TestRecord getTestRecord()
Gets the TestRecord attribute of the NetworkSimulator object

Returns:
The TestRecord value

getClosest

public DirectNodeHandle getClosest(NodeId nid)
Gets the Closest attribute of the NetworkSimulator object

Parameters:
nid - DESCRIBE THE PARAMETER
Returns:
The Closest value

setAlive

public void setAlive(NodeId nid,
                     boolean alive)
Sets the Alive attribute of the NetworkSimulator object

Parameters:
nid - The new Alive value
alive - The new Alive value

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection