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 |
static int |
DEFAULT_PROXIMITY
|
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 |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_PROXIMITY
public static final int DEFAULT_PROXIMITY
- See Also:
- Constant Field Values
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)
proximity
public int proximity(Identifier i)
- Specified by:
proximity
in interface ProximityProvider<Identifier>
pingResponse
public void pingResponse(Identifier i,
int rtt,
java.util.Map<java.lang.String,java.lang.Integer> 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.Integer> options)
- Description copied from interface:
PingListener
- Called when we receive a ping (not a pong)
- Specified by:
pingReceived
in interface PingListener<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.Integer> options)
Copyright © 2001-2005 - Rice Pastry.