java.lang.Object
net.i2p.router.dummy.DummyPeerManagerFacade
All Implemented Interfaces:
PeerManagerFacade, Service

public class DummyPeerManagerFacadeextends Object implements PeerManagerFacade
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.
  • Constructor Details

    • DummyPeerManagerFacade

      public DummyPeerManagerFacade()
      Constructor. Every peer operation is an empty stub, so a bare instance is already a complete dummy peer manager.
  • Method Details

    • shutdown

      public void shutdown()
      Description copied from interface: Service
      Instruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully. It should not depend on other components at this point. This call DOES block.
      Specified by:
      shutdown in interface Service
    • startup

      public void startup()
      Description copied from interface: Service
      Instruct the service that it should start normal operation. This call DOES block until the service is ready.
      Specified by:
      startup in interface Service
    • restart

      public void restart()
      Description copied from interface: Service
      Perform a soft restart.
      Specified by:
      restart in interface Service
    • renderStatusHTML

      public void renderStatusHTML(Writer out)
      Description copied from interface: Service
      Render the status as HTML.
      Specified by:
      renderStatusHTML in interface Service
      Parameters:
      out - the writer to write to
    • getPeersByCapability

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

      public int countPeersByCapability(char capability)
      Description copied from interface: PeerManagerFacade
      Count of peers with the given capability.
      Specified by:
      countPeersByCapability in interface PeerManagerFacade
      Parameters:
      capability - the capability code to match, e.g. 'f' for floodfill
      Returns:
      the number of known peers advertising that capability
    • setCapabilities

      public void setCapabilities(Hash peer, String caps)
      Description copied from interface: PeerManagerFacade
      The capabilities for a peer.
      Specified by:
      setCapabilities in interface PeerManagerFacade
      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

      public void removeCapabilities(Hash peer)
      Description copied from interface: PeerManagerFacade
      Remove all capabilities from a peer.
      Specified by:
      removeCapabilities in interface PeerManagerFacade
      Parameters:
      peer - the router hash of the peer to clear capabilities from
    • getPeerTestJob

      public PeerTestJob getPeerTestJob()
      Description copied from interface: PeerManagerFacade
      The peer test job for testing peers.
      Specified by:
      getPeerTestJob in interface PeerManagerFacade
      Returns:
      the peer test job