org.apache.ignite.internal.client.impl.connection

## Interface GridClientConnectionManager

All Known Implementing Classes:
  GridClientConnectionManagerAdapter, GridClientConnectionManagerOsImpl

    public interface GridClientConnectionManager

Common interface for client connection managers.

### Method Summary

Methods
`GridClientConnection` `connection(GridClientNode node)` Returns connection to the given node.
`void` `init(Collection<InetSocketAddress> srvs)` Tries to open initial connection and fetch topology using given server addresses.
`void` `stop(boolean waitCompletion)` Stops this instance of connection manager and terminates all connections.
`void` `terminateConnection(GridClientConnection conn, GridClientNode node, Throwable e)` Callback method, which should be called by clients when they get connectivity errors.

### Method Detail

#### init

    void init(Collection<InetSocketAddress> srvs)
              throws GridClientException,
                     InterruptedException

Tries to open initial connection and fetch topology using given server addresses.

Parameters:
  `srvs` - Collection<InetSocketAddress> server addresses.
Throws:
  `GridClientAuthenticationException` - If connection failed to authenticate on server.
  `GridClientException` - If manager failed to initialise,
  `InterruptedException` - If manager was interrupted while waiting for connection.

#### connection

    GridClientConnection connection(GridClientNode node)
                                    throws GridServerUnreachableException,
                                           GridClientClosedException,
                                           InterruptedException

Returns connection to the given node.

Parameters:
  `node` - Node to connect with.
Returns:
  Connection to use for operations, targeted for the given node.
Throws:
  `GridServerUnreachableException` - If connection can't be established.
  `InterruptedException` - If manager was interrupted while waiting for connection to be established.
  `GridClientClosedException` - If connection manager has been closed.

#### terminateConnection

    void terminateConnection(GridClientConnection conn,
                           @Nullable
                           GridClientNode node,
                           Throwable e)

Callback method, which should be called by clients when they get connectivity errors. It's main purpose is to allow connection manager to terminate broken connection early and, try to establish a new one for the consequent `connection(GridClientNode)` calls.

Parameters:
  `conn` - Failed connection.
  `node` - Connected node.
  `e` - Error that caused connection termination.

#### stop

    void stop(boolean waitCompletion)

Stops this instance of connection manager and terminates all connections.

Parameters:
  `waitCompletion` - If `true` this method awaits termination of all connections (and receiving responses for all pending requests), otherwise it will return immediately.

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.5.0.final
Release Date | : December 29 2015