|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectrice.pastry.direct.BasicNetworkSimulator
public abstract class BasicNetworkSimulator
| Field Summary | |
|---|---|
protected Logger |
logger
|
protected SelectorManager |
manager
|
protected int |
maxDiameter
|
protected int |
MIN_DELAY
|
protected int |
minDelay
|
protected RandomSource |
random
|
| Constructor Summary | |
|---|---|
BasicNetworkSimulator(Environment env)
|
|
| Method Summary | |
|---|---|
boolean |
addSimulatorListener(SimulatorListener sl)
|
ScheduledMessage |
deliverMessage(Message msg,
DirectPastryNode node)
node should always be a local node, because this will be delivered instantly |
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 node)
set the liveliness of a NodeId |
CancellableTask |
enqueueDelivery(Delivery d,
int delay)
Deliver message. |
DirectNodeHandle |
getClosest(DirectNodeHandle nh)
find the closest NodeId to an input NodeId out of all NodeIds in the network |
Environment |
getEnvironment()
|
TestRecord |
getTestRecord()
get TestRecord |
boolean |
isAlive(DirectNodeHandle nh)
testing if a NodeId is alive |
float |
networkDelay(DirectNodeHandle a,
DirectNodeHandle b)
computes the proximity between two NodeIds |
void |
notifySimulatorListeners(Message m,
NodeHandle from,
NodeHandle to,
int delay)
Call this when a message is sent. |
float |
proximity(DirectNodeHandle a,
DirectNodeHandle b)
Determines rtt between two nodes. |
void |
registerNode(DirectPastryNode dpn)
Registers a node handle with the simulator. |
void |
removeNode(DirectPastryNode node)
|
boolean |
removeSimulatorListener(SimulatorListener sl)
|
void |
setFullSpeed()
unlimited maxSpeed |
void |
setMaxSpeed(float speed)
The max rate of the simulator compared to realtime. |
void |
setTestRecord(TestRecord tr)
set TestRecord |
void |
start()
|
void |
stop()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface rice.pastry.direct.NetworkSimulator |
|---|
generateNodeRecord |
| Field Detail |
|---|
protected Logger logger
protected RandomSource random
protected int MIN_DELAY
protected SelectorManager manager
protected final int maxDiameter
protected final int minDelay
| Constructor Detail |
|---|
public BasicNetworkSimulator(Environment env)
| Method Detail |
|---|
public void start()
start in interface NetworkSimulatorpublic void stop()
stop in interface NetworkSimulatorpublic TestRecord getTestRecord()
getTestRecord in interface NetworkSimulatorpublic void setTestRecord(TestRecord tr)
setTestRecord in interface NetworkSimulatortr - input TestRecord
public CancellableTask enqueueDelivery(Delivery d,
int delay)
NetworkSimulator
enqueueDelivery in interface NetworkSimulator
public ScheduledMessage deliverMessage(Message msg,
DirectPastryNode node)
deliverMessage in interface NetworkSimulatormsg - message to deliver.node - the Pastry node to deliver it to.
public ScheduledMessage deliverMessage(Message msg,
DirectPastryNode node,
int delay)
NetworkSimulator
deliverMessage in interface NetworkSimulatormsg - message to deliver.node - the Pastry node to deliver it to.
public ScheduledMessage deliverMessage(Message msg,
DirectPastryNode node,
int delay,
int period)
NetworkSimulator
deliverMessage in interface NetworkSimulatormsg - message to deliver.node - the Pastry node to deliver it to.period - to deliver the message after the delay
public ScheduledMessage deliverMessageFixedRate(Message msg,
DirectPastryNode node,
int delay,
int period)
NetworkSimulator
deliverMessageFixedRate in interface NetworkSimulatormsg - message to deliver.node - the Pastry node to deliver it to.period - to deliver the message after the delaypublic void setMaxSpeed(float speed)
NetworkSimulator
setMaxSpeed in interface NetworkSimulatorpublic void setFullSpeed()
NetworkSimulator
setFullSpeed in interface NetworkSimulatorpublic boolean isAlive(DirectNodeHandle nh)
isAlive in interface NetworkSimulatornid - the NodeId being tested
public void destroy(DirectPastryNode node)
destroy in interface NetworkSimulatornid - the NodeId being setalive - the value being set
public float networkDelay(DirectNodeHandle a,
DirectNodeHandle b)
networkDelay in interface NetworkSimulatora - the first NodeIdb - the second NodeId
public float proximity(DirectNodeHandle a,
DirectNodeHandle b)
NetworkSimulator
proximity in interface NetworkSimulatora - a node id.b - another node id.
public DirectNodeHandle getClosest(DirectNodeHandle nh)
getClosest in interface NetworkSimulatornid - the input NodeId
public void registerNode(DirectPastryNode dpn)
NetworkSimulator
registerNode in interface NetworkSimulatorpublic void removeNode(DirectPastryNode node)
removeNode in interface NetworkSimulatorpublic Environment getEnvironment()
getEnvironment in interface NetworkSimulatorpublic boolean addSimulatorListener(SimulatorListener sl)
addSimulatorListener in interface NetworkSimulatorpublic boolean removeSimulatorListener(SimulatorListener sl)
removeSimulatorListener in interface NetworkSimulator
public void notifySimulatorListeners(Message m,
NodeHandle from,
NodeHandle to,
int delay)
NetworkSimulator
notifySimulatorListeners in interface NetworkSimulatorm - the messagefrom - the sourceto - the destinationdelay - the network proximity (when the message will be received)
|
Rice Pastry API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||