class PeerManager extends Object
| Modifier and Type | Field and Description |
|---|---|
(package private) static long | REORGANIZE_TIME_LONGWe don't want this much longer than the average connect time,
as the CapacityCalculator now includes connection as a factor. |
(package private) static int | REORGANIZES_PER_DAYAfter first two hours of uptime ~= 246 |
static String | TRACKED_CAPSTRACKED_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<Hash> | getPeersByCapability(char capability) |
(package private) void | loadProfiles()This may take a long time - 30 seconds or more |
void | removeCapabilities(Hash peer)removeCapabilities. |
(package private) Set<Hash> | selectPeers() |
(package private) List<Hash> | selectPeers(PeerSelectionCriteria criteria)Find some peers that meet the criteria and we have the netDb info for locally. |
void | setCapabilities(Hash peer,
String caps) |
(package private) void | storeProfiles()Write active profiles to disk |
static final long REORGANIZE_TIME_LONG
static final int REORGANIZES_PER_DAY
public static final String TRACKED_CAPS
public PeerManager(RouterContext context)
void clearProfiles()
public int countPeersByCapability(char capability)
capability - case-insensitivepublic Set<Hash> getPeersByCapability(char capability)
capability - case-insensitivevoid loadProfiles()
public void removeCapabilities(Hash peer)
List<Hash> selectPeers(PeerSelectionCriteria criteria)
public void setCapabilities(Hash peer, String caps)
caps - non-null, case is ignoredvoid storeProfiles()