|
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
DESCRIBE THE CLASS
Field Summary | |
---|---|
protected Logger |
logger
DESCRIBE THE FIELD |
protected SelectorManager |
manager
DESCRIBE THE FIELD |
protected int |
maxDiameter
DESCRIBE THE FIELD |
protected int |
MIN_DELAY
DESCRIBE THE FIELD |
protected int |
minDelay
DESCRIBE THE FIELD |
protected RandomSource |
random
DESCRIBE THE FIELD |
Constructor Summary | |
---|---|
BasicNetworkSimulator(Environment env)
Constructor for BasicNetworkSimulator. |
Method Summary | |
---|---|
boolean |
addSimulatorListener(SimulatorListener sl)
Adds the specified Simulator listener to receive Simulator events from this component. |
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)
DESCRIBE THE METHOD |
ScheduledMessage |
deliverMessage(Message msg,
DirectPastryNode node,
int delay,
int period)
DESCRIBE THE METHOD |
ScheduledMessage |
deliverMessageFixedRate(Message msg,
DirectPastryNode node,
int delay,
int period)
DESCRIBE THE METHOD |
void |
destroy(DirectPastryNode node)
set the liveliness of a NodeId |
CancellableTask |
enqueueDelivery(Delivery d,
int delay)
DESCRIBE THE METHOD |
DirectNodeHandle |
getClosest(DirectNodeHandle nh)
find the closest NodeId to an input NodeId out of all NodeIds in the network |
Environment |
getEnvironment()
Gets the Environment attribute of the BasicNetworkSimulator object |
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)
DESCRIBE THE METHOD |
float |
proximity(DirectNodeHandle a,
DirectNodeHandle b)
DESCRIBE THE METHOD |
void |
registerNode(DirectPastryNode dpn)
DESCRIBE THE METHOD |
void |
removeNode(DirectPastryNode node)
DESCRIBE THE METHOD |
boolean |
removeSimulatorListener(SimulatorListener sl)
Removes the specified Simulator listener so that it no longer receives Simulator events from this component. |
void |
setFullSpeed()
Sets the FullSpeed attribute of the BasicNetworkSimulator object |
void |
setMaxSpeed(float speed)
Sets the MaxSpeed attribute of the BasicNetworkSimulator object |
void |
setTestRecord(TestRecord tr)
set TestRecord |
void |
start()
DESCRIBE THE METHOD |
void |
stop()
DESCRIBE THE METHOD |
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)
env
- DESCRIBE THE PARAMETERMethod Detail |
---|
public TestRecord getTestRecord()
getTestRecord
in interface NetworkSimulator
public boolean isAlive(DirectNodeHandle nh)
isAlive
in interface NetworkSimulator
nh
- DESCRIBE THE PARAMETER
public DirectNodeHandle getClosest(DirectNodeHandle nh)
getClosest
in interface NetworkSimulator
nh
- DESCRIBE THE PARAMETER
public Environment getEnvironment()
getEnvironment
in interface NetworkSimulator
public void setTestRecord(TestRecord tr)
setTestRecord
in interface NetworkSimulator
tr
- input TestRecordpublic void setMaxSpeed(float speed)
setMaxSpeed
in interface NetworkSimulator
speed
- The new MaxSpeed valuepublic void setFullSpeed()
setFullSpeed
in interface NetworkSimulator
public void start()
start
in interface NetworkSimulator
public void stop()
stop
in interface NetworkSimulator
public CancellableTask enqueueDelivery(Delivery d, int delay)
enqueueDelivery
in interface NetworkSimulator
d
- DESCRIBE THE PARAMETERdelay
- DESCRIBE THE PARAMETER
public ScheduledMessage deliverMessage(Message msg, DirectPastryNode node)
deliverMessage
in interface NetworkSimulator
msg
- DESCRIBE THE PARAMETERnode
- DESCRIBE THE PARAMETER
public ScheduledMessage deliverMessage(Message msg, DirectPastryNode node, int delay)
deliverMessage
in interface NetworkSimulator
msg
- DESCRIBE THE PARAMETERnode
- DESCRIBE THE PARAMETERdelay
- DESCRIBE THE PARAMETER
public ScheduledMessage deliverMessage(Message msg, DirectPastryNode node, int delay, int period)
deliverMessage
in interface NetworkSimulator
msg
- DESCRIBE THE PARAMETERnode
- DESCRIBE THE PARAMETERdelay
- DESCRIBE THE PARAMETERperiod
- DESCRIBE THE PARAMETER
public ScheduledMessage deliverMessageFixedRate(Message msg, DirectPastryNode node, int delay, int period)
deliverMessageFixedRate
in interface NetworkSimulator
msg
- DESCRIBE THE PARAMETERnode
- DESCRIBE THE PARAMETERdelay
- DESCRIBE THE PARAMETERperiod
- DESCRIBE THE PARAMETER
public void destroy(DirectPastryNode node)
destroy
in interface NetworkSimulator
node
- DESCRIBE THE PARAMETERpublic float networkDelay(DirectNodeHandle a, DirectNodeHandle b)
networkDelay
in interface NetworkSimulator
a
- the first NodeIdb
- the second NodeId
public float proximity(DirectNodeHandle a, DirectNodeHandle b)
proximity
in interface NetworkSimulator
a
- DESCRIBE THE PARAMETERb
- DESCRIBE THE PARAMETER
public void registerNode(DirectPastryNode dpn)
registerNode
in interface NetworkSimulator
dpn
- DESCRIBE THE PARAMETERpublic void removeNode(DirectPastryNode node)
removeNode
in interface NetworkSimulator
node
- DESCRIBE THE PARAMETERpublic boolean addSimulatorListener(SimulatorListener sl)
addSimulatorListener
in interface NetworkSimulator
sl
- Contains the SimulatorListener for SimulatorEvent data.
public boolean removeSimulatorListener(SimulatorListener sl)
removeSimulatorListener
in interface NetworkSimulator
sl
- Contains the SimulatorListener for SimulatorEvent data.
public void notifySimulatorListeners(Message m, NodeHandle from, NodeHandle to, int delay)
notifySimulatorListeners
in interface NetworkSimulator
m
- DESCRIBE THE PARAMETERfrom
- DESCRIBE THE PARAMETERto
- DESCRIBE THE PARAMETERdelay
- DESCRIBE THE PARAMETER
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |