net.i2p.router

## Class ClientManagerFacade

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

- All Implemented Interfaces:
    Service
  Direct Known Subclasses:
    ClientManagerFacadeImpl, DummyClientManagerFacade

      public abstract class ClientManagerFacade
      extends Object
      implements Service

  Manages client connections and LeaseSet operations for I2P applications. Handles client registration, lease authorization, and session management for local services.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `PROP_CLIENT_ONLY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClientManagerFacade()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract FloodfillNetworkDatabaseFacade` | `getClientFloodfillNetworkDatabaseFacade(Hash destHash)` get the FloodfillNetworkDatabaseFacade associated with a particular client destination.
    `abstract SessionConfig` | `getClientSessionConfig(Destination dest)` Return the client's current config, or null if not connected
    `abstract SessionKeyManager` | `getClientSessionKeyManager(Hash dest)`
    `abstract Set<Hash>` | `getPrimaryHashes()` get a set of all primary hashes
    `boolean` | `isAlive()`
    `abstract boolean` | `isLocal(Destination dest)` Determine if the destination specified is managed locally.
    `abstract boolean` | `isLocal(Hash destHash)` Determine if the destination hash specified is managed locally.
    `Set<Destination>` | `listClients()` Return the list of locally connected clients
    `abstract void` | `messageDeliveryStatusUpdate(Destination fromDest, MessageId id, long messageNonce, int status)`
    `abstract void` | `messageReceived(ClientMessage msg)`
    `void` | `registerMetaDest(Destination dest)` Declare that we're going to publish a meta LS for this destination.
    `void` | `renderStatusHTML(Writer out)`
    `abstract void` | `reportAbuse(Destination dest, String reason, int severity)` Instruct the client (or all clients) that they are under attack.
    `abstract 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.
    `abstract void` | `requestLeaseSet(Hash dest, LeaseSet set)`
    `boolean` | `shouldPublishLeaseSet(Hash destinationHash)` Does the client specified want their leaseSet published?
    `abstract void` | `shutdown(String msg)`
    `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 java.lang.Object

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

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

      `restart, shutdown, startup`

- - ### Field Detail

    - #### PROP_CLIENT_ONLY

          public static final String PROP_CLIENT_ONLY

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### ClientManagerFacade

          public ClientManagerFacade()

  - ### Method Detail

    - #### getClientFloodfillNetworkDatabaseFacade

          public abstract 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.
      Parameters:
        `destHash` - destination hash associated with the client who's subDb we're looking for
      Returns:
        non-null FloodfillNetworkDatabaseFacade

    - #### getClientSessionConfig

          public abstract SessionConfig getClientSessionConfig(Destination dest)

      Return the client's current config, or null if not connected

    - #### getClientSessionKeyManager

          public abstract SessionKeyManager getClientSessionKeyManager(Hash dest)

    - #### getPrimaryHashes

          public abstract Set<Hash> getPrimaryHashes()

      get a set of all primary hashes
      Returns:
        non-null set of Hashes

    - #### isAlive

          public boolean isAlive()

    - #### isLocal

          public abstract boolean isLocal(Destination dest)

      Determine if the destination specified is managed locally. This call DOES block.
      Parameters:
        `dest` - Destination to be checked

    - #### isLocal

          public abstract boolean isLocal(Hash destHash)

      Determine if the destination hash specified is managed locally. This call DOES block.
      Parameters:
        `destHash` - Hash of Destination to be checked

    - #### listClients

          public Set<Destination> listClients()

      Return the list of locally connected clients
      Returns:
        set of Destination objects

    - #### messageDeliveryStatusUpdate

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

      Parameters:
        `id` - the router's ID for this message
        `messageNonce` - the client's ID for this message
        `status` - see I2CP MessageStatusMessage for success/failure codes

    - #### messageReceived

          public abstract void messageReceived(ClientMessage msg)

    - #### 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.
      Throws:
        `I2PSessionException` - on duplicate dest

    - #### renderStatusHTML

          public void renderStatusHTML(Writer out)
                                throws IOException

      Specified by:
        `renderStatusHTML` in interface `Service`
      Throws:
        `IOException`

    - #### reportAbuse

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

      Instruct the client (or all clients) that they are under attack. This call does not block.
      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 abstract 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.
      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)
        `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 abstract void requestLeaseSet(Hash dest,
                                               LeaseSet set)

    - #### shouldPublishLeaseSet

          public boolean shouldPublishLeaseSet(Hash destinationHash)

      Does the client specified want their leaseSet published?

    - #### shutdown

          public abstract void shutdown(String msg)

    - #### unregisterMetaDest

          public void unregisterMetaDest(Destination dest)

      Declare that we're no longer going to publish a meta LS for this destination.

    - #### verifyClientLiveliness

          public boolean verifyClientLiveliness()