|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.direct.BasicNetworkSimulator
public abstract class BasicNetworkSimulator
Field Summary | |
---|---|
protected Logger |
logger
|
protected SelectorManager |
manager
|
protected int |
MIN_DELAY
|
protected RandomSource |
random
|
protected java.util.TreeSet |
taskQueue
|
Constructor Summary | |
---|---|
BasicNetworkSimulator(Environment env)
|
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 node)
set the liveliness of a NodeId |
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 |
int |
proximity(DirectNodeHandle a,
DirectNodeHandle b)
computes the proximity between two NodeIds |
void |
registerNode(DirectPastryNode dpn)
Registers a node handle with the simulator. |
void |
removeNode(DirectPastryNode node)
|
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 java.util.TreeSet taskQueue
protected Logger logger
protected RandomSource random
protected int MIN_DELAY
protected SelectorManager manager
Constructor Detail |
---|
public BasicNetworkSimulator(Environment env)
Method Detail |
---|
public void start()
start
in interface NetworkSimulator
public void stop()
public TestRecord getTestRecord()
getTestRecord
in interface NetworkSimulator
public void setTestRecord(TestRecord tr)
setTestRecord
in interface NetworkSimulator
tr
- input TestRecordpublic ScheduledMessage deliverMessage(Message msg, DirectPastryNode node)
NetworkSimulator
deliverMessage
in interface NetworkSimulator
msg
- message to deliver.node
- the Pastry node to deliver it to.public ScheduledMessage deliverMessage(Message msg, DirectPastryNode node, int delay)
NetworkSimulator
deliverMessage
in interface NetworkSimulator
msg
- 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 NetworkSimulator
msg
- message to deliver.node
- the Pastry node to deliver it to.period
- to deliver the message after the delaypublic ScheduledMessage deliverMessageFixedRate(Message msg, DirectPastryNode node, int delay, int period)
NetworkSimulator
deliverMessageFixedRate
in interface NetworkSimulator
msg
- message to deliver.node
- the Pastry node to deliver it to.period
- to deliver the message after the delaypublic boolean isAlive(DirectNodeHandle nh)
isAlive
in interface NetworkSimulator
nid
- the NodeId being tested
public void destroy(DirectPastryNode node)
destroy
in interface NetworkSimulator
nid
- the NodeId being setalive
- the value being setpublic int proximity(DirectNodeHandle a, DirectNodeHandle b)
proximity
in interface NetworkSimulator
a
- the first NodeIdb
- the second NodeId
public DirectNodeHandle getClosest(DirectNodeHandle nh)
getClosest
in interface NetworkSimulator
nid
- the input NodeId
public void registerNode(DirectPastryNode dpn)
NetworkSimulator
registerNode
in interface NetworkSimulator
public void removeNode(DirectPastryNode node)
removeNode
in interface NetworkSimulator
public Environment getEnvironment()
getEnvironment
in interface NetworkSimulator
|
ePOST API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |