|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.limegroup.gnutella.bootstrap.BootstrapServerManager
public class BootstrapServerManager
A list of GWebCache servers. Provides methods to fetch address addresses from these servers, find the addresses of more such servers, and update the addresses of these and other servers.
Information on the GWebCache protocol can be found at http://zero-g.net/gwebcache/specs.html
Field Summary | |
---|---|
static java.io.File |
bootstrapServers
|
static int |
CACHE_OFF
GWebCache use is turned off. |
static int |
FETCH_IN_PROGRESS
The fetch wasn't scheduled because one is in progress. |
static int |
FETCH_SCHEDULED
A fetch was scheduled. |
static int |
FETCHED_TOO_MANY
Too many endpoints were already fetch, the fetch wasn't scheduled. |
static int |
MAX_HOSTS_PER_REQUEST
The maximum number of hosts to try per request. |
static int |
NO_CACHES_LEFT
All caches were already contacted atleast once. |
static int |
UPDATE_DELAY_MSEC
The amount of time in milliseconds between update requests. |
Constructor Summary | |
---|---|
protected |
BootstrapServerManager()
Creates a new BootstrapServerManager. |
Method Summary | |
---|---|
void |
addBootstrapServer(BootstrapServer server)
Adds server to this. |
void |
bootstrapServersAdded()
Notification that all bootstrap servers have been added. |
void |
fetchBootstrapServersAsync()
Asynchronously fetches other bootstrap URLs and stores them in this. |
int |
fetchEndpointsAsync()
Asynchronously fetches host addresses from bootstrap servers and stores them in the HostCatcher. |
int |
fetchEndpointsAsyncV2()
Asynchronously fetches host addresses from bootstrap servers and stores them in the HostCatcher. |
java.util.Iterator |
getBootstrapServers()
Returns an iterator of the bootstrap servers in this, each as a BootstrapServer, in any order. |
static BootstrapServerManager |
instance()
Accessor for the BootstrapServerManager instance. |
boolean |
isEndpointFetchInProgress()
Determines whether or not an endpoint fetch is in progress. |
protected int |
randomServer()
Returns an random valid index of SERVERS. |
protected void |
removeServer(BootstrapServer server)
Removes the server. |
void |
resetData()
Resets information related to the caches & endpoints we've fetched. |
void |
sendUpdatesAsync(ServerInfo myIP)
Asynchronously sends an update message to a cache. |
void |
sendUpdatesAsyncV2(ServerInfo myIP)
Asynchronously sends an update message to a cache. |
protected int |
size()
Returns the number of servers in this. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.io.File bootstrapServers
public static final int CACHE_OFF
public static final int FETCH_SCHEDULED
public static final int FETCH_IN_PROGRESS
public static final int FETCHED_TOO_MANY
public static final int NO_CACHES_LEFT
public static int MAX_HOSTS_PER_REQUEST
public static int UPDATE_DELAY_MSEC
Constructor Detail |
---|
protected BootstrapServerManager()
Method Detail |
---|
public static BootstrapServerManager instance()
public void addBootstrapServer(BootstrapServer server)
public void bootstrapServersAdded()
public void resetData()
public boolean isEndpointFetchInProgress()
public java.util.Iterator getBootstrapServers()
public void fetchBootstrapServersAsync()
public int fetchEndpointsAsync()
public int fetchEndpointsAsyncV2()
public void sendUpdatesAsync(ServerInfo myIP)
myIP
- my listening address and port
NullPointerException
- if the ip param is nullpublic void sendUpdatesAsyncV2(ServerInfo myIP)
myIP
- my listening address and port
NullPointerException
- if the ip param is nullprotected int size()
protected int randomServer()
protected void removeServer(BootstrapServer server)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |