ClientConfigBuilder

ClientConfigBuilder

Builds a ClientConfig instance.

Methods

withConnectTimeout(connectTimeoutnon-null) → {ClientConfigBuilder}

Sets the connect timeout. It should be greater than zero.

Parameters:
Name Type Description
connectTimeout Number

Determines the timeout in milliseconds until a connection is established in the API calls. Default value is 10000 milliseconds

Returns:

This Builder instance to add any additional parameters.

Type
ClientConfigBuilder

withReadTimeout(readTimeoutnon-null) → {ClientConfigBuilder}

Sets the read timeout. It should be greater than zero.

Parameters:
Name Type Description
readTimeout Number

Defines the read timeout in milliseconds, which is the timeout for waiting for data or, put differently, a maximum period inactivity between two consecutive data packets. Default value is 20000 milliseconds

Returns:

This Builder instance to add any additional parameters.

Type
ClientConfigBuilder

fromFile(clientConfigFilePathnon-null) → {ClientConfigBuilder}

Sets the connect timeout and read timeout using the JSON client config file path. All the keys in the JSON structure are optional.

JSON structure:

{
  "connectTimeout": "4000",
  "readTimeout": "20000"
}
Parameters:
Name Type Description
clientConfigFilePath String

JSON client config file path

Returns:

This Builder instance to add any additional parameters.

Type
ClientConfigBuilder

build() → {ClientConfig}

Returns a new ClientConfig instance built from the current state of this builder.

Returns:

A ClientConfig instance.

Type
ClientConfig