Package com.symphony.bdk.http.api
Interface ApiClientBuilder
@API(status=STABLE)
public interface ApiClientBuilder
Builder class to create a new instance of an
ApiClient
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
withAuthentication
(String name, Authentication authentication) Puts an authentication scheme.withBasePath
(String basePath) default ApiClientBuilder
withConnectionPoolMax
(Integer connectionPoolMax) Custom setting specific forcom.symphony.bdk.http.jersey2.ApiClientBuilderJersey2
only, it setorg.apache.http.impl.conn.PoolingHttpClientConnectionManager#setMaxTotal
If not set or set null, maximum connections per each route will be 20default ApiClientBuilder
withConnectionPoolPerRoute
(Integer connectionPoolPerRoute) Custom setting specific forcom.symphony.bdk.http.jersey2.ApiClientBuilderJersey2
only, it setorg.apache.http.impl.conn.PoolingHttpClientConnectionManager#setDefaultMaxPerRoute
If not set or set null, maximum connections per each route will be 20withConnectionTimeout
(Integer connectionTimeout) Sets the connection timeout (in milliseconds).withDefaultHeader
(String key, String value) withKeyStore
(byte[] keyStoreBytes, String keyStorePassword) Sets a proxy host and port.withProxyCredentials
(String proxyUser, String proxyPassword) Sets proxy credentials.withReadTimeout
(Integer readTimeout) Sets the read timeout (in milliseconds).withTemporaryFolderPath
(String temporaryFolderPath) withTrustStore
(byte[] trustStoreBytes, String trustStorePassword) withUserAgent
(String userAgent)
-
Field Details
-
DEFAULT_READ_TIMEOUT
static final int DEFAULT_READ_TIMEOUT- See Also:
-
DEFAULT_CONNECT_TIMEOUT
static final int DEFAULT_CONNECT_TIMEOUT- See Also:
-
DEFAULT_CONNECTION_POOL_MAX
static final int DEFAULT_CONNECTION_POOL_MAX- See Also:
-
-
Method Details
-
build
ApiClient build()- Returns:
- a new
ApiClient
based on the previously called methods below.
-
withBasePath
- Parameters:
basePath
- base URL to be used for HTTP calls- Returns:
- the updated instance of
ApiClientBuilder
-
withUserAgent
- Parameters:
userAgent
- user agent value to be put in the User-Agent header- Returns:
- the updated instance of
ApiClientBuilder
-
withKeyStore
- Parameters:
keyStoreBytes
- content of the key store (aka client certificate)keyStorePassword
- password of the key store- Returns:
- the updated instance of
ApiClientBuilder
-
withTrustStore
- Parameters:
trustStoreBytes
- content of the trust storetrustStorePassword
- password of the truststore- Returns:
- the updated instance of
ApiClientBuilder
-
withDefaultHeader
- Parameters:
key
- name of the header to be added in all HTTP callsvalue
- header value- Returns:
- the updated instance of
ApiClientBuilder
-
withTemporaryFolderPath
- Parameters:
temporaryFolderPath
- temporary folder path where to download files sent as response- Returns:
- the updated instance of
ApiClientBuilder
-
withConnectionTimeout
Sets the connection timeout (in milliseconds). A value of 0 means no timeout, otherwise values must be between 1 andInteger.MAX_VALUE
. If not set or set null, connection timeout will be 15000.- Parameters:
connectionTimeout
- Connection timeout in milliseconds- Returns:
- the updated instance of
ApiClientBuilder
-
withReadTimeout
Sets the read timeout (in milliseconds). A value of 0 means no timeout, otherwise values must be between 1 andInteger.MAX_VALUE
. If not set or set null, read timeout will be 60000.- Parameters:
readTimeout
- Read timeout in milliseconds- Returns:
- the updated instance of
ApiClientBuilder
-
withConnectionPoolMax
Custom setting specific forcom.symphony.bdk.http.jersey2.ApiClientBuilderJersey2
only, it setorg.apache.http.impl.conn.PoolingHttpClientConnectionManager#setMaxTotal
If not set or set null, maximum connections per each route will be 20- Parameters:
connectionPoolMax
- maximum connections in the pool- Returns:
- the updated instance of
ApiClientBuilder
-
withConnectionPoolPerRoute
Custom setting specific forcom.symphony.bdk.http.jersey2.ApiClientBuilderJersey2
only, it setorg.apache.http.impl.conn.PoolingHttpClientConnectionManager#setDefaultMaxPerRoute
If not set or set null, maximum connections per each route will be 20- Parameters:
connectionPoolPerRoute
- maximum connections per each route- Returns:
- the updated instance of
ApiClientBuilder
-
withProxy
Sets a proxy host and port.- Parameters:
proxyHost
- the proxy hostproxyPort
- the proxy port- Returns:
- the updated instance of
ApiClientBuilder
-
withProxyCredentials
Sets proxy credentials.- Parameters:
proxyUser
- the proxy user to be specifiedproxyPassword
- the proxy password to be specified- Returns:
- the updated instance of
ApiClientBuilder
-
withAuthentication
Puts an authentication scheme.- Parameters:
name
- Authentication scheme name.authentication
- Authentication scheme implementation.- Returns:
- the updated instance of
ApiClientBuilder
-