Rice Pastry API

org.mpisws.p2p.transport.proximity
Class MinRTTProximityProvider<Identifier>

java.lang.Object
  extended by 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>


Nested Class Summary
 class MinRTTProximityProvider.EntityManager
          Internal class which is charges with managing the remote connection via a specific route
 
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
 
Fields inherited from interface org.mpisws.p2p.transport.proximity.ProximityProvider
DEFAULT_PROXIMITY
 
Constructor Summary
MinRTTProximityProvider(Pinger<Identifier> tl, Environment env)
           
 
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
 

Field Detail

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

Constructor Detail

MinRTTProximityProvider

public MinRTTProximityProvider(Pinger<Identifier> tl,
                               Environment env)
Method Detail

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 from
rtt - the RTT
options - 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)

Rice Pastry API

Copyright © 2001-2005 - Rice Pastry.


Imprint-Dataprotection