org.mpisws.p2p.transport.proximity
Class MinRTTProximityProvider<Identifier>
java.lang.Object
org.mpisws.p2p.transport.proximity.MinRTTProximityProvider<Identifier>
- All Implemented Interfaces:
- PingListener<Identifier>, ProximityProvider<Identifier>
public class MinRTTProximityProvider<Identifier>
- extends java.lang.Object
- implements ProximityProvider<Identifier>, PingListener<Identifier>
Field Summary |
int |
PROX_TIMEOUT
millis for the timeout
The idea is that we don't want this parameter to change too fast,
so this is the timeout for it to increase, you could set this to infinity,
but that may be bad because it doesn't account for intermediate link failures |
Method Summary |
void |
addProximityListener(ProximityListener<Identifier> listener)
|
void |
clearState(Identifier i)
|
MinRTTProximityProvider.EntityManager |
getManager(Identifier i)
|
void |
notifyProximityListeners(Identifier i,
int prox,
java.util.Map<java.lang.String,java.lang.Object> options)
|
void |
pingReceived(Identifier i,
java.util.Map<java.lang.String,java.lang.Object> options)
Called when we receive a ping (not a pong) |
void |
pingResponse(Identifier i,
int rtt,
java.util.Map<java.lang.String,java.lang.Object> options)
Pong received. |
int |
proximity(Identifier i,
java.util.Map<java.lang.String,java.lang.Object> options)
|
boolean |
removeProximityListener(ProximityListener<Identifier> listener)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PROX_TIMEOUT
public int PROX_TIMEOUT
- millis for the timeout
The idea is that we don't want this parameter to change too fast,
so this is the timeout for it to increase, you could set this to infinity,
but that may be bad because it doesn't account for intermediate link failures
MinRTTProximityProvider
public MinRTTProximityProvider(Pinger<Identifier> tl,
Environment env)
proximity
public int proximity(Identifier i,
java.util.Map<java.lang.String,java.lang.Object> options)
- Specified by:
proximity
in interface ProximityProvider<Identifier>
pingResponse
public void pingResponse(Identifier i,
int rtt,
java.util.Map<java.lang.String,java.lang.Object> options)
- Description copied from interface:
PingListener
- Pong received.
- Specified by:
pingResponse
in interface PingListener<Identifier>
- Parameters:
i
- Where the ping was fromrtt
- the RTToptions
- how the ping was sent (source route/udp etc)
pingReceived
public void pingReceived(Identifier i,
java.util.Map<java.lang.String,java.lang.Object> options)
- Description copied from interface:
PingListener
- Called when we receive a ping (not a pong)
- Specified by:
pingReceived
in interface PingListener<Identifier>
clearState
public void clearState(Identifier i)
- Specified by:
clearState
in interface ProximityProvider<Identifier>
getManager
public MinRTTProximityProvider.EntityManager getManager(Identifier i)
addProximityListener
public void addProximityListener(ProximityListener<Identifier> listener)
- Specified by:
addProximityListener
in interface ProximityProvider<Identifier>
removeProximityListener
public boolean removeProximityListener(ProximityListener<Identifier> listener)
- Specified by:
removeProximityListener
in interface ProximityProvider<Identifier>
notifyProximityListeners
public void notifyProximityListeners(Identifier i,
int prox,
java.util.Map<java.lang.String,java.lang.Object> options)
Copyright © 2001-2005 - Rice Pastry.