java.lang.Object
net.i2p.router.dummy.DummyPeerManagerFacade
- All Implemented Interfaces:
PeerManagerFacade, 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.
Constructor Summary
ConstructorsMethod Summary
All MethodsModifier and TypeMethodDescriptionintcountPeersByCapability(char capability) Count of peers with the given capability.getPeersByCapability(char capability) All peers with the given capability.The peer test job for testing peers.voidremoveCapabilities(Hash peer) Remove all capabilities from a peer.voidrenderStatusHTML(Writer out) Render the status as HTML.voidrestart()Perform a soft restart.voidsetCapabilities(Hash peer, String caps) The capabilities for a peer.voidshutdown()Instruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully.voidstartup()Instruct the service that it should start normal operation.
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:ServiceInstruct 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.startup
restart
renderStatusHTML
Description copied from interface:ServiceRender the status as HTML.- Specified by:
renderStatusHTMLin interfaceService- Parameters:
out- the writer to write to
getPeersByCapability
Description copied from interface:PeerManagerFacadeAll peers with the given capability.- Specified by:
getPeersByCapabilityin interfacePeerManagerFacade- 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:PeerManagerFacadeCount of peers with the given capability.- Specified by:
countPeersByCapabilityin interfacePeerManagerFacade- Parameters:
capability- the capability code to match, e.g.'f'for floodfill- Returns:
- the number of known peers advertising that capability
setCapabilities
Description copied from interface:PeerManagerFacadeThe capabilities for a peer.- Specified by:
setCapabilitiesin interfacePeerManagerFacade- Parameters:
peer- the router hash of the peer whose capabilities are to be setcaps- the peer's capabilities, a case-insensitive string of PeerCapability chars
removeCapabilities
Description copied from interface:PeerManagerFacadeRemove all capabilities from a peer.- Specified by:
removeCapabilitiesin interfacePeerManagerFacade- Parameters:
peer- the router hash of the peer to clear capabilities from
getPeerTestJob
Description copied from interface:PeerManagerFacadeThe peer test job for testing peers.- Specified by:
getPeerTestJobin interfacePeerManagerFacade- Returns:
- the peer test job