class PeerManager extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static int |
REORGANIZES_PER_DAY
After first two hours of uptime ~= 246
|
static String |
TRACKED_CAPS |
| Constructor and Description |
|---|
PeerManager(RouterContext context)
Profiles are now loaded in a separate thread,
so this should return quickly.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
clearProfiles() |
int |
countPeersByCapability(char capability) |
Set<net.i2p.data.Hash> |
getPeersByCapability(char capability) |
(package private) void |
loadProfiles()
This may take a long time - 30 seconds or more
|
void |
removeCapabilities(net.i2p.data.Hash peer) |
(package private) Set<net.i2p.data.Hash> |
selectPeers() |
(package private) List<net.i2p.data.Hash> |
selectPeers(PeerSelectionCriteria criteria)
Find some peers that meet the criteria and we have the netDb info for locally.
|
void |
setCapabilities(net.i2p.data.Hash peer,
String caps) |
(package private) void |
storeProfile(net.i2p.data.Hash peer) |
(package private) void |
storeProfiles() |
static final int REORGANIZES_PER_DAY
public static final String TRACKED_CAPS
public PeerManager(RouterContext context)
void storeProfiles()
void clearProfiles()
Set<net.i2p.data.Hash> selectPeers()
void storeProfile(net.i2p.data.Hash peer)
void loadProfiles()
List<net.i2p.data.Hash> selectPeers(PeerSelectionCriteria criteria)
public void setCapabilities(net.i2p.data.Hash peer,
String caps)
caps - non-null, case is ignoredpublic void removeCapabilities(net.i2p.data.Hash peer)
public Set<net.i2p.data.Hash> getPeersByCapability(char capability)
capability - case-insensitivepublic int countPeersByCapability(char capability)
capability - case-insensitive