com.limegroup.gnutella
Class SupernodeAssigner

java.lang.Object
  extended bycom.limegroup.gnutella.SupernodeAssigner

public final class SupernodeAssigner
extends java.lang.Object

This class determines whether or not this node has all of the necessary characteristics for it to become a ultrapeer if necessary. The criteria uses include the node's upload and download bandwidth, the operating system, the node's firewalled status, the average uptime, the current uptime, etc.

One of this class's primary functions is to run the timer that continually checks the amount of bandwidth passed through upstream and downstream HTTP file transfers. It records the maximum of the sum of these streams to determine the node's bandwidth.


Field Summary
static int TIMER_DELAY
          Constant for the number of milliseconds between the timer's calls to its Runnables.
 
Constructor Summary
SupernodeAssigner(BandwidthTracker uploadTracker, BandwidthTracker downloadTracker, ConnectionManager manager)
          Creates a new UltrapeerAssigner.
 
Method Summary
static boolean isTooGoodToPassUp()
          Accessor for whether or not this machine has settings that are too good to pass up for Ultrapeer election.
 void start()
          Schedules a timer event to continually updates the upload and download bandwidth used.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TIMER_DELAY

public static final int TIMER_DELAY
Constant for the number of milliseconds between the timer's calls to its Runnables.

See Also:
Constant Field Values
Constructor Detail

SupernodeAssigner

public SupernodeAssigner(BandwidthTracker uploadTracker,
                         BandwidthTracker downloadTracker,
                         ConnectionManager manager)
Creates a new UltrapeerAssigner.

Parameters:
uploadTracker - the BandwidthTracker instance for tracking bandwidth used for uploads
downloadTracker - the BandwidthTracker instance for tracking bandwidth used for downloads
manager - Reference to the ConnectionManager for this node
Method Detail

start

public void start()
Schedules a timer event to continually updates the upload and download bandwidth used. Non-blocking.


isTooGoodToPassUp

public static boolean isTooGoodToPassUp()
Accessor for whether or not this machine has settings that are too good to pass up for Ultrapeer election.

Returns:
true if this node has extremely good Ultrapeer settings, otherwise false