ePOST API

rice.pastry.direct
Interface NetworkSimulator

All Known Implementing Classes:
BasicNetworkSimulator, EuclideanNetwork, GenericNetwork, SphereNetwork

public interface NetworkSimulator

Interface to an object which is simulating the network.

Version:
$Id: NetworkSimulator.java 3038 2006-02-07 10:01:01Z jeffh $
Author:
Andrew Ladd

Method Summary
 ScheduledMessage deliverMessage(Message msg, DirectPastryNode node)
          Deliver message ASAP.
 ScheduledMessage deliverMessage(Message msg, DirectPastryNode node, int delay)
          Deliver message.
 ScheduledMessage deliverMessage(Message msg, DirectPastryNode node, int delay, int period)
          Deliver message.
 ScheduledMessage deliverMessageFixedRate(Message msg, DirectPastryNode node, int delay, int period)
          Deliver message.
 void destroy(DirectPastryNode dpn)
           
 NodeRecord generateNodeRecord()
          Generates a random node record
 DirectNodeHandle getClosest(DirectNodeHandle nh)
          Returns the closest Node in proximity.
 Environment getEnvironment()
           
 TestRecord getTestRecord()
           
 boolean isAlive(DirectNodeHandle nh)
          Checks to see if a node id is alive.
 int proximity(DirectNodeHandle a, DirectNodeHandle b)
          Determines proximity between two nodes.
 void registerNode(DirectPastryNode dpn)
          Registers a node handle with the simulator.
 void removeNode(DirectPastryNode node)
           
 void setTestRecord(TestRecord tr)
           
 void start()
           
 

Method Detail

getEnvironment

Environment getEnvironment()

registerNode

void registerNode(DirectPastryNode dpn)
Registers a node handle with the simulator.

Parameters:
nh - the node handle to register.

isAlive

boolean isAlive(DirectNodeHandle nh)
Checks to see if a node id is alive.

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

proximity

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

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

deliverMessage

ScheduledMessage deliverMessage(Message msg,
                                DirectPastryNode node,
                                int delay)
Deliver message.

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

deliverMessage

ScheduledMessage deliverMessage(Message msg,
                                DirectPastryNode node,
                                int delay,
                                int period)
Deliver message.

Parameters:
msg - message to deliver.
node - the Pastry node to deliver it to.
how - long to delay to deliver the message
period - to deliver the message after the delay

deliverMessageFixedRate

ScheduledMessage deliverMessageFixedRate(Message msg,
                                         DirectPastryNode node,
                                         int delay,
                                         int period)
Deliver message.

Parameters:
msg - message to deliver.
node - the Pastry node to deliver it to.
how - long to delay to deliver the message
period - to deliver the message after the delay

deliverMessage

ScheduledMessage deliverMessage(Message msg,
                                DirectPastryNode node)
Deliver message ASAP.

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

setTestRecord

void setTestRecord(TestRecord tr)

getTestRecord

TestRecord getTestRecord()

getClosest

DirectNodeHandle getClosest(DirectNodeHandle nh)
Returns the closest Node in proximity.

Parameters:
nid -
Returns:

destroy

void destroy(DirectPastryNode dpn)

generateNodeRecord

NodeRecord generateNodeRecord()
Generates a random node record

Returns:

removeNode

void removeNode(DirectPastryNode node)

start

void start()

ePOST API

Copyright © 2001-2005 - Rice Pastry.