com.hazelcast.client

## Interface ClientEndpointManager

-     @PrivateApi
      public interface ClientEndpointManager

  A manager for `ClientEndpoint`s. All the methods are thread-safe.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Removes all endpoints.
    `ClientEndpoint` | `getEndpoint(Connection connection)` Gets the endpoint for a given connection.
    `Collection<ClientEndpoint>` | `getEndpoints()` Returns the current endpoints.
    `Set<ClientEndpoint>` | `getEndpoints(String clientUuid)` Gets all the endpoints for a given client.
    `boolean` | `registerEndpoint(ClientEndpoint endpoint)` Registers an endpoint with this ClientEndpointManager.
    `void` | `removeEndpoint(ClientEndpoint endpoint)` Removes an endpoint from this ClientEndpointManager.
    `int` | `size()` Returns the current number of endpoints.

- - ### Method Detail

    - #### getEndpoints

          Collection<ClientEndpoint> getEndpoints()

      Returns the current endpoints.
      Returns:
        the endpoints.

    - #### getEndpoint

          ClientEndpoint getEndpoint(Connection connection)

      Gets the endpoint for a given connection.
      Parameters:
        `connection` - the connection to the endpoint.
      Returns:
        the found endpoint or null of no endpoint was found.
      Throws:
        `NullPointerException` - if connection is null.

    - #### getEndpoints

          Set<ClientEndpoint> getEndpoints(String clientUuid)

      Gets all the endpoints for a given client.
      Parameters:
        `clientUuid` - the UUID of the client
      Returns:
        a set of all the endpoints for the client. If no endpoints are found, an empty set is returned.
      Throws:
        `NullPointerException` - if clientUuid is null.

    - #### size

          int size()

      Returns the current number of endpoints.
      Returns:
        the current number of endpoints.

    - #### clear

          void clear()

      Removes all endpoints. Nothing is done on the endpoints themselves; they are just removed from this ClientEndpointManager. Can safely be called when there are no endpoints.

    - #### registerEndpoint

          boolean registerEndpoint(ClientEndpoint endpoint)

      Registers an endpoint with this ClientEndpointManager. If the endpoint already is registered, the call is ignored.
      Parameters:
        `endpoint` - the endpoint to register.
      Returns:
        false if an endpoint is already registered
      Throws:
        `NullPointerException` - if endpoint is null.

    - #### removeEndpoint

          void removeEndpoint(ClientEndpoint endpoint)

      Removes an endpoint from this ClientEndpointManager. Closes associated connection and runs all registered destroy actions to endpoint. No action taken if endpoint is not registered or already removed
      Parameters:
        `endpoint` - the endpoint to remove.
      Throws:
        `NullPointerException` - if endpoint is null.

Copyright © 2018. All rights reserved.