Package net.i2p.router.peermanager
Class PeerManager
java.lang.Object
net.i2p.router.peermanager.PeerManager
class PeerManager extends Object
Manage the current state of the statistics
Also maintain Sets for each of the capabilities in TRACKED_CAPS.
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
REORGANIZES_PER_DAY
After first two hours of uptime ~= 246static String
TRACKED_CAPS
-
Constructor Summary
Constructors Constructor Description PeerManager(RouterContext context)
Profiles are now loaded in a separate thread, so this should return quickly. -
Method Summary
Modifier and Type Method 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 morevoid
removeCapabilities(Hash peer)
(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
storeProfile(Hash peer)
(package private) void
storeProfiles()
-
Field Details
-
REORGANIZES_PER_DAY
static final int REORGANIZES_PER_DAYAfter first two hours of uptime ~= 246- See Also:
- Constant Field Values
-
TRACKED_CAPS
- See Also:
- Constant Field Values
-
-
Constructor Details
-
PeerManager
Profiles are now loaded in a separate thread, so this should return quickly.
-
-
Method Details
-
storeProfiles
void storeProfiles() -
clearProfiles
void clearProfiles()- Since:
- 0.8.8
-
selectPeers
-
storeProfile
-
loadProfiles
void loadProfiles()This may take a long time - 30 seconds or more -
selectPeers
Find some peers that meet the criteria and we have the netDb info for locally. Returned list will not include ourselves. Only used by PeerTestJob (PURPOSE_TEST) -
setCapabilities
- Parameters:
caps
- non-null, case is ignored
-
removeCapabilities
-
getPeersByCapability
- Parameters:
capability
- case-insensitive- Returns:
- non-null unmodifiable set
-
countPeersByCapability
public int countPeersByCapability(char capability)- Parameters:
capability
- case-insensitive- Returns:
- how many
- Since:
- 0.9.45
-