org.apache.ignite.internal.client

## Class GridClientFactory

- java.lang.Object
- - org.apache.ignite.internal.client.GridClientFactory

    public class GridClientFactory
    extends Object

Client factory opens and closes clients. It also tracks all currently opened clients as well.

### Method Summary

All Methods Static Methods Concrete Methods
`static GridClient` `start(GridClientConfiguration cfg)` Starts a client with given configuration.
`static void` `stop(UUID clientId)` Waits for all pending requests for a particular client to be completed (no new requests will be accepted) and then closes the client.
`static void` `stop(UUID clientId, boolean wait)` Stops particular client.
`static void` `stopAll()` Waits for all open clients to finish their operations and stops them, This method is equivalent to `stopAll(true)` method invocation.
`static void` `stopAll(boolean wait)` Stops all currently open clients.

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

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

### Method Detail

#### start

    public static GridClient start(GridClientConfiguration cfg)
                            throws GridClientException

Starts a client with given configuration. Starting client will be assigned a randomly generated UUID which can be obtained by `GridClient.id()` method.

Parameters:
  `cfg` - Client configuration.
Returns:
  Started client.
Throws:
  `GridClientException` - If client could not be created.

#### stopAll

    public static void stopAll()

Waits for all open clients to finish their operations and stops them, This method is equivalent to `stopAll(true)` method invocation.

See Also:
  `stopAll(boolean)`

#### stopAll

    public static void stopAll(boolean wait)

Stops all currently open clients.

Parameters:
  `wait` - If `true` then each client will wait to finish all ongoing requests before closing (however, no new requests will be accepted). If `false`, clients will be closed immediately and all ongoing requests will be failed.

#### stop

    public static void stop(UUID clientId)

Waits for all pending requests for a particular client to be completed (no new requests will be accepted) and then closes the client. This method is equivalent to `stop(clientId, true)`.

Parameters:
  `clientId` - Identifier of client to close.
See Also:
  `stop(UUID, boolean)`

#### stop

    public static void stop(UUID clientId,
                            boolean wait)

Stops particular client.

Parameters:
  `clientId` - Client identifier to close.
  `wait` - If `true` then client will wait to finish all ongoing requests before closing (however, no new requests will be accepted). If `false`, client will be closed immediately and all ongoing requests will be failed.

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.7.6
Release Date | : September 11 2019