|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object rice.pastry.direct.NetworkSimulatorImpl
public class NetworkSimulatorImpl
Field Summary | |
---|---|
protected ProximityGenerator |
generator
|
protected LivenessProvider<NodeHandle> |
livenessProvider
|
protected RandomSource |
random
|
protected BasicNetworkSimulator<NodeHandle,RawMessage> |
simulator
|
Constructor Summary | |
---|---|
NetworkSimulatorImpl(Environment env,
ProximityGenerator generator)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected BasicNetworkSimulator<NodeHandle,RawMessage> simulator
protected RandomSource random
protected ProximityGenerator generator
protected LivenessProvider<NodeHandle> livenessProvider
Constructor Detail |
---|
public NetworkSimulatorImpl(Environment env, ProximityGenerator generator)
Method Detail |
---|
public Environment getEnvironment()
getEnvironment
in interface NetworkSimulator
public void setFullSpeed()
NetworkSimulator
setFullSpeed
in interface NetworkSimulator
public void setMaxSpeed(float rate)
NetworkSimulator
setMaxSpeed
in interface NetworkSimulator
public void start()
start
in interface NetworkSimulator
public void stop()
stop
in interface NetworkSimulator
public TestRecord getTestRecord()
getTestRecord
in interface NetworkSimulator
public void setTestRecord(TestRecord tr)
setTestRecord
in interface NetworkSimulator
tr
- input TestRecordpublic boolean addSimulatorListener(SimulatorListener sl)
addSimulatorListener
in interface NetworkSimulator
public boolean removeSimulatorListener(SimulatorListener sl)
removeSimulatorListener
in interface NetworkSimulator
public void notifySimulatorListenersSent(Message m, NodeHandle from, NodeHandle to, int delay)
NetworkSimulator
notifySimulatorListenersSent
in interface NetworkSimulator
m
- the messagefrom
- the sourceto
- the destinationdelay
- the network proximity (when the message will be received)public void notifySimulatorListenersReceived(Message m, NodeHandle from, NodeHandle to)
NetworkSimulator
notifySimulatorListenersReceived
in interface NetworkSimulator
m
- the messagefrom
- the sourceto
- the destinationpublic void destroy(DirectPastryNode dpn)
destroy
in interface NetworkSimulator
public CancellableTask enqueueDelivery(Delivery del, int delay)
NetworkSimulator
enqueueDelivery
in interface NetworkSimulator
public NodeRecord generateNodeRecord()
NetworkSimulator
generateNodeRecord
in interface NetworkSimulator
public DirectNodeHandle getClosest(DirectNodeHandle nh)
NetworkSimulator
getClosest
in interface NetworkSimulator
public boolean isAlive(DirectNodeHandle nh)
NetworkSimulator
isAlive
in interface NetworkSimulator
public float networkDelay(DirectNodeHandle a, DirectNodeHandle b)
NetworkSimulator
networkDelay
in interface NetworkSimulator
a
- a node id.b
- another node id.
public float proximity(DirectNodeHandle a, DirectNodeHandle b)
NetworkSimulator
proximity
in interface NetworkSimulator
a
- a node id.b
- another node id.
public void removeNode(TLPastryNode node)
NetworkSimulator
removeNode
in interface NetworkSimulator
public NodeRecord getNodeRecord(DirectNodeHandle handle)
getNodeRecord
in interface NetworkSimulator
public LivenessProvider<NodeHandle> getLivenessProvider()
getLivenessProvider
in interface NetworkSimulator
public GenericNetworkSimulator<NodeHandle,RawMessage> getGenericSimulator()
getGenericSimulator
in interface NetworkSimulator
public void registerNode(TLPastryNode dpn, NodeRecord nr)
|
Rice Pastry API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |