net.i2p.router.peermanager
Class PeerManager

java.lang.Object
  extended by 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
static String TRACKED_CAPS
           
 
Constructor Summary
PeerManager(RouterContext context)
          Profiles are now loaded in a separate thread, so this should return quickly.
 
Method Summary
(package private)  void clearProfiles()
           
 Set<Hash> getPeersByCapability(char capability)
           
(package private)  void loadProfiles()
          This may take a long time - 30 seconds or more
 void 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()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACKED_CAPS

public static final String TRACKED_CAPS
See Also:
Constant Field Values
Constructor Detail

PeerManager

public PeerManager(RouterContext context)
Profiles are now loaded in a separate thread, so this should return quickly.

Method Detail

storeProfiles

void storeProfiles()

clearProfiles

void clearProfiles()
Since:
0.8.8

selectPeers

Set<Hash> selectPeers()

storeProfile

void storeProfile(Hash peer)

loadProfiles

void loadProfiles()
This may take a long time - 30 seconds or more


selectPeers

List<Hash> selectPeers(PeerSelectionCriteria criteria)
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

public void setCapabilities(Hash peer,
                            String caps)
Parameters:
caps - non-null, case is ignored

removeCapabilities

public void removeCapabilities(Hash peer)

getPeersByCapability

public Set<Hash> getPeersByCapability(char capability)
Parameters:
capability - case-insensitive
Returns:
non-null unmodifiable set