net.i2p.router.client

## Class ClientManagerFacadeImpl

- java.lang.Object
- - net.i2p.router.ClientManagerFacade
  - - net.i2p.router.client.ClientManagerFacadeImpl

- All Implemented Interfaces:
    InternalClientManager, Service

      public class ClientManagerFacadeImpl
      extends ClientManagerFacade
      implements InternalClientManager

  Base impl of the client facade

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `DEFAULT_HOST`
    `static int` | `DEFAULT_PORT`
    `static String` | `PROP_CLIENT_HOST` Note that this is different than the property the client side uses, i2cp.tcp.host
    `static String` | `PROP_CLIENT_PORT` Note that this is different than the property the client side uses, i2cp.tcp.port

    - ### Fields inherited from class net.i2p.router.ClientManagerFacade

      `PROP_CLIENT_ONLY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientManagerFacadeImpl(RouterContext context)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `I2CPMessageQueue` | `connect()` The InternalClientManager interface.
    `FloodfillNetworkDatabaseFacade` | `getClientFloodfillNetworkDatabaseFacade(Hash destHash)` get the FloodfillNetworkDatabaseFacade associated with a particular client destination.
    `SessionConfig` | `getClientSessionConfig(Destination dest)` Return the client's current config, or null if not connected
    `SessionKeyManager` | `getClientSessionKeyManager(Hash dest)` Return the client's current manager or null if not connected
    `Set<Hash>` | `getPrimaryHashes()` get all the primary hashes for all the clients and return them as a set
    `boolean` | `isAlive()`
    `boolean` | `isLocal(Destination dest)` Determine if the destination specified is managed locally.
    `boolean` | `isLocal(Hash destHash)` Determine if the destination specified is managed locally.
    `Set<Destination>` | `listClients()` Return the list of locally connected clients
    `void` | `messageDeliveryStatusUpdate(Destination fromDest, MessageId id, long messageNonce, int status)`
    `void` | `messageReceived(ClientMessage msg)`
    `void` | `registerMetaDest(Destination dest)` Declare that we're going to publish a meta LS for this destination.
    `void` | `reportAbuse(Destination dest, String reason, int severity)` Instruct the client (or all clients) that they are under attack.
    `void` | `requestLeaseSet(Destination dest, LeaseSet set, long timeout, Job onCreateJob, Job onFailedJob)` Request that a particular client authorize the Leases contained in the LeaseSet, after which the onCreateJob is queued up.
    `void` | `requestLeaseSet(Hash dest, LeaseSet set)` Request that a particular client authorize the Leases contained in the LeaseSet.
    `void` | `restart()` Perform a soft restart.
    `boolean` | `shouldPublishLeaseSet(Hash destinationHash)` Does the client specified want their leaseSet published?
    `void` | `shutdown()` Instruct the service that the router is shutting down and that it should do whatever is necessary to go down gracefully.
    `void` | `shutdown(String msg)`
    `void` | `startup()` Instruct the service that it should start normal operation.
    `void` | `unregisterMetaDest(Destination dest)` Declare that we're no longer going to publish a meta LS for this destination.
    `boolean` | `verifyClientLiveliness()`

    - ### Methods inherited from class net.i2p.router.ClientManagerFacade

      `renderStatusHTML`

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

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

- - ### Field Detail

    - #### DEFAULT_HOST

          public static final String DEFAULT_HOST

      See Also:
        Constant Field Values

    - #### DEFAULT_PORT

          public static final int DEFAULT_PORT

      See Also:
        Constant Field Values

    - #### PROP_CLIENT_HOST

          public static final String PROP_CLIENT_HOST

      Note that this is different than the property the client side uses, i2cp.tcp.host
      See Also:
        Constant Field Values

    - #### PROP_CLIENT_PORT

          public static final String PROP_CLIENT_PORT

      Note that this is different than the property the client side uses, i2cp.tcp.port
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ClientManagerFacadeImpl

          public ClientManagerFacadeImpl(RouterContext context)

  - ### Method Detail

    - #### connect

          public I2CPMessageQueue connect()
                                   throws I2PSessionException

      The InternalClientManager interface. Connect to the router, receiving a message queue to talk to the router with.
      Specified by:
        `connect` in interface `InternalClientManager`
      Throws:
        `I2PSessionException` - if the router isn't ready

    - #### getClientFloodfillNetworkDatabaseFacade

          public FloodfillNetworkDatabaseFacade getClientFloodfillNetworkDatabaseFacade(Hash destHash)

      get the FloodfillNetworkDatabaseFacade associated with a particular client destination. This is inside the runner, so it won't be there if the runner isn't ready.
      Specified by:
        `getClientFloodfillNetworkDatabaseFacade` in class `ClientManagerFacade`
      Parameters:
        `destHash` - destination hash associated with the client who's subDb we're looking for
      Returns:
        the netdb or null

    - #### getClientSessionConfig

          public SessionConfig getClientSessionConfig(Destination dest)

      Return the client's current config, or null if not connected
      Specified by:
        `getClientSessionConfig` in class `ClientManagerFacade`

    - #### getClientSessionKeyManager

          public SessionKeyManager getClientSessionKeyManager(Hash dest)

      Return the client's current manager or null if not connected
      Specified by:
        `getClientSessionKeyManager` in class `ClientManagerFacade`

    - #### getPrimaryHashes

          public Set<Hash> getPrimaryHashes()

      get all the primary hashes for all the clients and return them as a set
      Specified by:
        `getPrimaryHashes` in class `ClientManagerFacade`
      Returns:
        all the hashes or an empty set, non-null

    - #### isAlive

          public boolean isAlive()

      Overrides:
        `isAlive` in class `ClientManagerFacade`

    - #### isLocal

          public boolean isLocal(Destination dest)

      Determine if the destination specified is managed locally. This call DOES block.
      Specified by:
        `isLocal` in class `ClientManagerFacade`
      Parameters:
        `dest` - Destination to be checked

    - #### isLocal

          public boolean isLocal(Hash destHash)

      Determine if the destination specified is managed locally. This call DOES block.
      Specified by:
        `isLocal` in class `ClientManagerFacade`
      Parameters:
        `destHash` - Hash of Destination to be checked

    - #### listClients

          public Set<Destination> listClients()

      Return the list of locally connected clients
      Overrides:
        `listClients` in class `ClientManagerFacade`
      Returns:
        set of Destination objects

    - #### messageDeliveryStatusUpdate

          public void messageDeliveryStatusUpdate(Destination fromDest,
                                                  MessageId id,
                                                  long messageNonce,
                                                  int status)

      Specified by:
        `messageDeliveryStatusUpdate` in class `ClientManagerFacade`
      Parameters:
        `id` - the router's ID for this message
        `messageNonce` - the client's ID for this message, greater than zero
        `status` - see I2CP MessageStatusMessage for success/failure codes

    - #### messageReceived

          public void messageReceived(ClientMessage msg)

      Specified by:
        `messageReceived` in class `ClientManagerFacade`

    - #### registerMetaDest

          public void registerMetaDest(Destination dest)
                                throws I2PSessionException

      Declare that we're going to publish a meta LS for this destination. Must be called before publishing the leaseset.
      Overrides:
        `registerMetaDest` in class `ClientManagerFacade`
      Throws:
        `I2PSessionException` - on duplicate dest

    - #### reportAbuse

          public void reportAbuse(Destination dest,
                                  String reason,
                                  int severity)

      Instruct the client (or all clients) that they are under attack. This call does not block.
      Specified by:
        `reportAbuse` in class `ClientManagerFacade`
      Parameters:
        `dest` - Destination under attack, or null if all destinations are affected
        `reason` - Why the router thinks that there is abusive behavior
        `severity` - How severe the abuse is, with 0 being not severe and 255 is the max

    - #### requestLeaseSet

          public void requestLeaseSet(Destination dest,
                                      LeaseSet set,
                                      long timeout,
                                      Job onCreateJob,
                                      Job onFailedJob)

      Request that a particular client authorize the Leases contained in the LeaseSet, after which the onCreateJob is queued up. If that doesn't occur within the timeout specified, queue up the onFailedJob. This call does not block. UNUSED, the call below without jobs is always used.
      Specified by:
        `requestLeaseSet` in class `ClientManagerFacade`
      Parameters:
        `dest` - Destination from which the LeaseSet's authorization should be requested
        `set` - LeaseSet with requested leases - this object must be updated to contain the signed version (as well as any changed/added/removed Leases) The LeaseSet contains Leases only; it is unsigned and does not have the destination set.
        `timeout` - ms to wait before failing
        `onCreateJob` - Job to run after the LeaseSet is authorized
        `onFailedJob` - Job to run after the timeout passes without receiving authorization

    - #### requestLeaseSet

          public void requestLeaseSet(Hash dest,
                                      LeaseSet set)

      Request that a particular client authorize the Leases contained in the LeaseSet.
      Specified by:
        `requestLeaseSet` in class `ClientManagerFacade`
      Parameters:
        `dest` - Destination from which the LeaseSet's authorization should be requested
        `set` - LeaseSet with requested leases - this object must be updated to contain the signed version (as well as any changed/added/removed Leases). The LeaseSet contains Leases only; it is unsigned and does not have the destination set.

    - #### restart

          public void restart()

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

    - #### shouldPublishLeaseSet

          public boolean shouldPublishLeaseSet(Hash destinationHash)

      Description copied from class: `ClientManagerFacade`
      Does the client specified want their leaseSet published?
      Overrides:
        `shouldPublishLeaseSet` in class `ClientManagerFacade`

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

    - #### shutdown

          public void shutdown(String msg)

      Specified by:
        `shutdown` in class `ClientManagerFacade`
      Parameters:
        `msg` - message to send to the clients

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

    - #### unregisterMetaDest

          public void unregisterMetaDest(Destination dest)

      Declare that we're no longer going to publish a meta LS for this destination.
      Overrides:
        `unregisterMetaDest` in class `ClientManagerFacade`

    - #### verifyClientLiveliness

          public boolean verifyClientLiveliness()

      Overrides:
        `verifyClientLiveliness` in class `ClientManagerFacade`