Interface ApiClientBuilder


@API(status=STABLE) public interface ApiClientBuilder
Builder class to create a new instance of an ApiClient
  • Field Details

  • Method Details

    • build

      ApiClient build()
      Returns:
      a new ApiClient based on the previously called methods below.
    • withBasePath

      ApiClientBuilder withBasePath(String basePath)
      Parameters:
      basePath - base URL to be used for HTTP calls
      Returns:
      the updated instance of ApiClientBuilder
    • withUserAgent

      ApiClientBuilder withUserAgent(String userAgent)
      Parameters:
      userAgent - user agent value to be put in the User-Agent header
      Returns:
      the updated instance of ApiClientBuilder
    • withKeyStore

      ApiClientBuilder withKeyStore(byte[] keyStoreBytes, String keyStorePassword)
      Parameters:
      keyStoreBytes - content of the key store (aka client certificate)
      keyStorePassword - password of the key store
      Returns:
      the updated instance of ApiClientBuilder
    • withTrustStore

      ApiClientBuilder withTrustStore(byte[] trustStoreBytes, String trustStorePassword)
      Parameters:
      trustStoreBytes - content of the trust store
      trustStorePassword - password of the truststore
      Returns:
      the updated instance of ApiClientBuilder
    • withDefaultHeader

      ApiClientBuilder withDefaultHeader(String key, String value)
      Parameters:
      key - name of the header to be added in all HTTP calls
      value - header value
      Returns:
      the updated instance of ApiClientBuilder
    • withTemporaryFolderPath

      ApiClientBuilder withTemporaryFolderPath(String temporaryFolderPath)
      Parameters:
      temporaryFolderPath - temporary folder path where to download files sent as response
      Returns:
      the updated instance of ApiClientBuilder
    • withConnectionTimeout

      ApiClientBuilder withConnectionTimeout(Integer connectionTimeout)
      Sets the connection timeout (in milliseconds). A value of 0 means no timeout, otherwise values must be between 1 and Integer.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

      ApiClientBuilder withReadTimeout(Integer readTimeout)
      Sets the read timeout (in milliseconds). A value of 0 means no timeout, otherwise values must be between 1 and Integer.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

      default ApiClientBuilder withConnectionPoolMax(Integer connectionPoolMax)
      Custom setting specific for com.symphony.bdk.http.jersey2.ApiClientBuilderJersey2 only, it set org.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

      default ApiClientBuilder withConnectionPoolPerRoute(Integer connectionPoolPerRoute)
      Custom setting specific for com.symphony.bdk.http.jersey2.ApiClientBuilderJersey2 only, it set org.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

      ApiClientBuilder withProxy(String proxyHost, int proxyPort)
      Sets a proxy host and port.
      Parameters:
      proxyHost - the proxy host
      proxyPort - the proxy port
      Returns:
      the updated instance of ApiClientBuilder
    • withProxyCredentials

      ApiClientBuilder withProxyCredentials(String proxyUser, String proxyPassword)
      Sets proxy credentials.
      Parameters:
      proxyUser - the proxy user to be specified
      proxyPassword - the proxy password to be specified
      Returns:
      the updated instance of ApiClientBuilder
    • withAuthentication

      ApiClientBuilder withAuthentication(String name, Authentication authentication)
      Puts an authentication scheme.
      Parameters:
      name - Authentication scheme name.
      authentication - Authentication scheme implementation.
      Returns:
      the updated instance of ApiClientBuilder