public abstract class GridClientConnectionManagerAdapter extends Object implements GridClientConnectionManager
| Modifier and Type | Field and Description |
|---|---|
protected GridClientConfiguration |
cfg
Client configuration.
|
| Modifier | Constructor and Description |
|---|---|
protected |
GridClientConnectionManagerAdapter(UUID clientId,
SSLContext sslCtx,
GridClientConfiguration cfg,
Collection<InetSocketAddress> routers,
GridClientTopology top,
@Nullable Byte marshId,
boolean routerClient,
boolean beforeNodeStart) |
| Modifier and Type | Method and Description |
|---|---|
protected GridClientConnection |
connect(@Nullable UUID nodeId,
Collection<InetSocketAddress> srvs)
Creates a connected facade and returns it.
|
protected GridClientConnection |
connect(@Nullable UUID nodeId,
InetSocketAddress addr)
Create new connection to specified server.
|
GridClientConnection |
connection(Collection<InetSocketAddress> srvs)
Returns connection to node using given server addresses.
|
GridClientConnection |
connection(GridClientNode node)
Gets active communication facade.
|
GridClientConnection |
connection(@Nullable UUID nodeId,
Collection<InetSocketAddress> srvs)
Returns connection to one of the given addresses.
|
void |
init(Collection<InetSocketAddress> srvs)
Tries to open initial connection and fetch topology using given server addresses.
|
protected abstract void |
init0()
Additional initialization.
|
void |
stop(boolean waitCompletion)
Closes all opened connections.
|
void |
terminateConnection(GridClientConnection conn,
GridClientNode node,
Throwable e)
Callback method, which should be called by clients when they get connectivity errors.
|
protected final GridClientConfiguration cfg
protected GridClientConnectionManagerAdapter(UUID clientId, SSLContext sslCtx, GridClientConfiguration cfg, Collection<InetSocketAddress> routers, GridClientTopology top, @Nullable @Nullable Byte marshId, boolean routerClient, boolean beforeNodeStart) throws GridClientException
clientId - Client ID.sslCtx - SSL context to enable secured connection or null to use unsecured one.cfg - Client configuration.routers - Routers or empty collection to use endpoints from topology info.top - Topology.marshId - Marshaller ID.beforeNodeStart - Connecting to a node before starting it without getting/updating topology.GridClientException - In case of error.public void init(Collection<InetSocketAddress> srvs) throws GridClientException, InterruptedException
init in interface GridClientConnectionManagersrvs - CollectionGridClientAuthenticationException - If connection failed to authenticate on server.GridClientException - If manager failed to initialise,InterruptedException - If manager was interrupted while waiting for connection.protected abstract void init0()
throws GridClientException
GridClientException - In case of error.public GridClientConnection connection(GridClientNode node) throws GridClientClosedException, GridServerUnreachableException, InterruptedException
connection in interface GridClientConnectionManagernode - Remote node to which connection should be established.GridServerUnreachableException - If none of the servers can be reached after the exception.GridClientClosedException - If client was closed manually.InterruptedException - If connection was interrupted.public GridClientConnection connection(@Nullable @Nullable UUID nodeId, Collection<InetSocketAddress> srvs) throws GridServerUnreachableException, GridClientClosedException, InterruptedException
nodeId - UUID of node for mapping with connection.
null if no need of mapping.srvs - Collection of addresses to connect to.GridServerUnreachableException - If connection can't be established.GridClientClosedException - If connections manager has been closed already.InterruptedException - If connection was interrupted.protected GridClientConnection connect(@Nullable @Nullable UUID nodeId, Collection<InetSocketAddress> srvs) throws GridServerUnreachableException, InterruptedException
nodeId - UUID of node for mapping with connection.
null if no need of mapping.srvs - List of server addresses that this method will try to connect to.GridServerUnreachableException - If none of the servers can be reached.InterruptedException - If connection was interrupted.protected GridClientConnection connect(@Nullable @Nullable UUID nodeId, InetSocketAddress addr) throws IOException, GridClientException, InterruptedException
nodeId - UUID of node for mapping with connection.
null if no need of mapping.addr - Remote socket to connect.IOException - If connection failed.GridClientException - If protocol error happened.InterruptedException - If thread was interrupted before connection was established.public void terminateConnection(GridClientConnection conn, GridClientNode node, Throwable e)
GridClientConnectionManager.connection(GridClientNode) calls.terminateConnection in interface GridClientConnectionManagerconn - Failed connection.node - Connected node.e - Error that caused connection termination.public void stop(boolean waitCompletion)
stop in interface GridClientConnectionManagerwaitCompletion - If true waits for all pending requests to be proceeded.public GridClientConnection connection(Collection<InetSocketAddress> srvs) throws GridClientException, InterruptedException
connection in interface GridClientConnectionManagersrvs - Server addresses.GridClientException - If failed.InterruptedException - If was interrupted while waiting for connection to be established.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.11.0 Release Date : September 11 2021