All Superinterfaces:
Service
All Known Implementing Classes:
DummyPeerManagerFacade, PeerManagerFacadeImpl

public interface PeerManagerFacade extends Service
Manage peer references and keep them up to date so that when asked for peers, it can provide appropriate peers according to the criteria provided. This includes periodically queueing up outbound messages to the peers to test them.
  • Method Details

    • getPeersByCapability

      Set<Hash> getPeersByCapability(char capability)
      All peers with the given capability.
      Parameters:
      capability - the capability code to match, e.g. 'f' for floodfill
      Returns:
      the peers by capability
    • countPeersByCapability

      int countPeersByCapability(char capability)
      Count of peers with the given capability.
      Parameters:
      capability - the capability code to match, e.g. 'f' for floodfill
      Returns:
      the number of known peers advertising that capability
    • setCapabilities

      void setCapabilities(Hash peer, String caps)
      The capabilities for a peer.
      Parameters:
      peer - the router hash of the peer whose capabilities are to be set
      caps - the peer's capabilities, a case-insensitive string of PeerCapability chars
    • removeCapabilities

      void removeCapabilities(Hash peer)
      Remove all capabilities from a peer.
      Parameters:
      peer - the router hash of the peer to clear capabilities from
    • getPeerTestJob

      PeerTestJob getPeerTestJob()
      The peer test job for testing peers.
      Returns:
      the peer test job