|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NetworkSimulator
Interface to an object which is simulating the network.
Method Summary | |
---|---|
boolean |
addSimulatorListener(SimulatorListener sl)
|
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)
|
CancellableTask |
enqueueDelivery(Delivery del,
int delay)
Deliver message. |
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. |
float |
networkDelay(DirectNodeHandle a,
DirectNodeHandle b)
Determines delivery time from a to b. |
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 rate)
The max rate of the simulator compared to realtime. |
void |
setTestRecord(TestRecord tr)
|
void |
start()
|
void |
stop()
|
Method Detail |
---|
Environment getEnvironment()
void registerNode(DirectPastryNode dpn)
nh
- the node handle to register.boolean isAlive(DirectNodeHandle nh)
nid
- a node id.
float proximity(DirectNodeHandle a, DirectNodeHandle b)
a
- a node id.b
- another node id.
float networkDelay(DirectNodeHandle a, DirectNodeHandle b)
a
- a node id.b
- another node id.
ScheduledMessage deliverMessage(Message msg, DirectPastryNode node, int delay)
msg
- message to deliver.node
- the Pastry node to deliver it to.how
- long to delay to deliver the messageScheduledMessage deliverMessage(Message msg, DirectPastryNode node, int delay, int period)
msg
- message to deliver.node
- the Pastry node to deliver it to.how
- long to delay to deliver the messageperiod
- to deliver the message after the delayScheduledMessage deliverMessageFixedRate(Message msg, DirectPastryNode node, int delay, int period)
msg
- message to deliver.node
- the Pastry node to deliver it to.how
- long to delay to deliver the messageperiod
- to deliver the message after the delayScheduledMessage deliverMessage(Message msg, DirectPastryNode node)
msg
- message to deliver.node
- the Pastry node to deliver it to.void setTestRecord(TestRecord tr)
TestRecord getTestRecord()
DirectNodeHandle getClosest(DirectNodeHandle nh)
nid
-
void destroy(DirectPastryNode dpn)
NodeRecord generateNodeRecord()
void removeNode(DirectPastryNode node)
void start()
void stop()
CancellableTask enqueueDelivery(Delivery del, int delay)
msg
- message to deliver.node
- the Pastry node to deliver it to.how
- long to delay to deliver the messageperiod
- to deliver the message after the delayvoid setMaxSpeed(float rate)
the
- multiple on realtime that the simulator is allowed to run at,
zero or less will cause no bound on the simulation speedvoid setFullSpeed()
void notifySimulatorListeners(Message m, NodeHandle from, NodeHandle to, int delay)
m
- the messagefrom
- the sourceto
- the destinationdelay
- the network proximity (when the message will be received)boolean addSimulatorListener(SimulatorListener sl)
sl
-
boolean removeSimulatorListener(SimulatorListener sl)
sl
-
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |