net.i2p.router.peermanager

## Class PeerManagerFacadeImpl

- java.lang.Object
- - net.i2p.router.peermanager.PeerManagerFacadeImpl

- All Implemented Interfaces:
    PeerManagerFacade, Service

      public class PeerManagerFacadeImpl
      extends Object
      implements PeerManagerFacade

  Base implementation that has simple algorithms and periodically saves state

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `PeerManagerFacadeImpl(RouterContext ctx)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `countPeersByCapability(char capability)`
    `Set<Hash>` | `getPeersByCapability(char capability)`
    `void` | `removeCapabilities(Hash peer)`
    `void` | `restart()` Perform a soft restart.
    `void` | `setCapabilities(Hash peer, String caps)`
    `void` | `shutdown()` Instruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully.
    `void` | `startup()` Instruct the service that it should start normal operation.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface net.i2p.router.Service

      `renderStatusHTML`

- - ### Constructor Detail

    - #### PeerManagerFacadeImpl

          public PeerManagerFacadeImpl(RouterContext ctx)

  - ### Method Detail

    - #### countPeersByCapability

          public int countPeersByCapability(char capability)

      Specified by:
        `countPeersByCapability` in interface `PeerManagerFacade`
      Parameters:
        `capability` - case-insensitive
      Returns:
        how many

    - #### getPeersByCapability

          public Set<Hash> getPeersByCapability(char capability)

      Specified by:
        `getPeersByCapability` in interface `PeerManagerFacade`
      Parameters:
        `capability` - case-insensitive
      Returns:
        non-null unmodifiable set

    - #### removeCapabilities

          public void removeCapabilities(Hash peer)

      Specified by:
        `removeCapabilities` in interface `PeerManagerFacade`

    - #### restart

          public void restart()

      Description copied from interface: `Service`
      Perform a soft restart.
      Specified by:
        `restart` in interface `Service`

    - #### setCapabilities

          public void setCapabilities(Hash peer,
                                      String caps)

      Specified by:
        `setCapabilities` in interface `PeerManagerFacade`
      Parameters:
        `caps` - non-null

    - #### 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`