Class ClientConfig.Builder

    • Constructor Detail

      • Builder

        public Builder()
        Constructs a Builder instance.
    • Method Detail

      • setRegion

        public ClientConfig.Builder setRegion​(Region region)
        Sets the region code.
        Parameters:
        region - a Region instance. Default value is US.
        Returns:
        this Builder instance to add any additional parameters
      • withConnectTimeout

        public ClientConfig.Builder withConnectTimeout​(Integer connectTimeout)
        Sets the connect timeout. It should be greater than zero.
        Parameters:
        connectTimeout - 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
      • withProxyServerConfig

        public ClientConfig.Builder withProxyServerConfig​(ProxyServerConfig proxyServerConfig)
        Sets the configuration for proxy server.
        Parameters:
        proxyServerConfig - a ProxyServerConfig instance for providing proxy server configuration.
        Returns:
        this Builder instance to add any additional parameters
      • withSocketTimeout

        public ClientConfig.Builder withSocketTimeout​(Integer socketTimeout)
        Sets the socket timeout. It should be greater than zero.
        Parameters:
        socketTimeout - Defines the socket 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 2000 milliseconds
        Returns:
        this Builder instance to add any additional parameters
      • fromFile

        public ClientConfig.Builder fromFile​(String clientConfigFilePath)
        Sets the connect timeout, socket timeout, processing timeout and proxy server config using the JSON client config file path. Default value for socket timeout is 2000 milliseconds, for connect timeout is 10000 milliseconds and for processing timeout is 600000 milliseconds (10 minutes).

        JSON structure:

         {
           "connectTimeout": "4000",
           "socketTimeout": "20000",
           "proxyServerConfig": {
             "host": "127.0.0.1",
             "port": "8080",
             "scheme": "https",
             "usernamePasswordCredentials": {
               "username": "username",
               "password": "password"
             }
           },
           "region": "EU"
         }
         
        Returns:
        this Builder instance to add any additional parameters
      • build

        public ClientConfig build()
        Returns a new ClientConfig instance built from the current state of this builder.
        Returns:
        a new ClientConfig instance.