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.6 2002/04/01 05:40:15 druschel Exp $
Author:
Andrew Ladd

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

Method Detail

registerNodeId

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

Parameters:
nh - the node handle to register.

isAlive

public boolean isAlive(rice.pastry.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(rice.pastry.NodeId a,
                     rice.pastry.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(rice.pastry.messaging.Message msg,
                           rice.pastry.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(rice.pastry.direct.TestRecord tr)

getTestRecord

public rice.pastry.direct.TestRecord getTestRecord()

getClosest

public rice.pastry.direct.DirectNodeHandle getClosest(rice.pastry.NodeId nid)

setAlive

public void setAlive(rice.pastry.NodeId nid,
                     boolean alive)

Rice Pastry API

Copyright © 2001 - Rice Pastry.


Imprint-Dataprotection