network
Class MaintainNeighbors

java.lang.Object
  extended bynetwork.MaintainNeighbors
All Implemented Interfaces:
java.lang.Runnable

public class MaintainNeighbors
extends java.lang.Object
implements java.lang.Runnable

Periodically checks if the number of neighbors is below the minimum number of neighbors. If it is, it tries to add more neighbors.

Author:
hoele

Constructor Summary
MaintainNeighbors(Network network)
          Creates a new MaintainNeighbors TimerTask.
 
Method Summary
 void run()
          If the number of neighbors is under minimum, try to add some neighbors from the cache.
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaintainNeighbors

public MaintainNeighbors(Network network)
Creates a new MaintainNeighbors TimerTask.

Parameters:
network - The network of neighbors to maintain.
Method Detail

start

public void start()

run

public void run()
If the number of neighbors is under minimum, try to add some neighbors from the cache. If the cache doesn't have any neighbors, ask current neighbors for IPs to add to the cache.

Specified by:
run in interface java.lang.Runnable

stop

public void stop()