Class Configuration

    • Constructor Detail

      • Configuration

        public Configuration()
    • Method Detail

      • apiUrl

        public Configuration apiUrl​(java.lang.String apiUrl)
        Set the API URL for the http client.
        Parameters:
        apiUrl - The URL.
        Returns:
        This object.
      • getApiUrl

        public java.lang.String getApiUrl()
        Get the API URL that was set.
        Specified by:
        getApiUrl in interface BaseConfiguration
        Returns:
        The url.
      • getUserAgent

        public java.lang.String getUserAgent()
        Get the user agent.
        Specified by:
        getUserAgent in interface BaseConfiguration
        Returns:
        The user agent.
      • credentials

        public Configuration credentials​(Credentials credentials)
        Set the credentials.
        Parameters:
        credentials - The credentials.
        Returns:
        This object.
      • getCredentials

        public Credentials getCredentials()
        Get the credentials.
        Returns:
        The credentials.
      • readTimeout

        public Configuration readTimeout​(java.time.Duration readTimeout)
        Set the read timeout for the http client.

        This is the value used by default for each request, though it can be overridden on a per-request basis with a request interceptor.

        Parameters:
        readTimeout - The read timeout used by default by the http client. Setting this value to null resets the timeout to an effectively infinite value.
        Returns:
        This object.
      • getReadTimeout

        public java.time.Duration getReadTimeout()
        Get the read timeout that was set.
        Specified by:
        getReadTimeout in interface BaseConfiguration
        Returns:
        The read timeout, or null if no timeout was set. Null represents an infinite wait time.
      • connectTimeout

        public Configuration connectTimeout​(java.time.Duration connectTimeout)
        Sets the connect timeout (in milliseconds) for the http client.

        In the case where a new connection needs to be established, if the connection cannot be established within the given duration, then HttpClient::send throws an HttpConnectTimeoutException, or HttpClient::sendAsync completes exceptionally with an HttpConnectTimeoutException. If a new connection does not need to be established, for example if a connection can be reused from a previous request, then this timeout duration has no effect.

        Parameters:
        connectTimeout - connection timeout in milliseconds
        Returns:
        This object.
      • getConnectTimeout

        public java.time.Duration getConnectTimeout()
        Get connection timeout (in milliseconds).
        Specified by:
        getConnectTimeout in interface BaseConfiguration
        Returns:
        Timeout in milliseconds
      • maxRetries

        public Configuration maxRetries​(int maxRetries)
      • minimumRetryDelay

        public Configuration minimumRetryDelay​(java.time.Duration minimumRetryDelay)
      • defaultHeaders

        public Configuration defaultHeaders​(java.util.Map<java.lang.String,​java.lang.String> defaultHeaders)
      • getDefaultHeaders

        public java.util.Map<java.lang.String,​java.lang.String> getDefaultHeaders()