Class HttpConfigurationBuilder

    • Field Detail

      • connectTimeoutMillis

        protected int connectTimeoutMillis
      • useReport

        protected boolean useReport
      • wrapperName

        protected java.lang.String wrapperName
      • wrapperVersion

        protected java.lang.String wrapperVersion
    • Constructor Detail

      • HttpConfigurationBuilder

        public HttpConfigurationBuilder()
    • Method Detail

      • connectTimeoutMillis

        public HttpConfigurationBuilder connectTimeoutMillis​(int connectTimeoutMillis)
        Sets the connection timeout. This is the time allowed for the SDK to make a socket connection to any of the LaunchDarkly services.

        The default is DEFAULT_CONNECT_TIMEOUT_MILLIS.

        Parameters:
        connectTimeoutMillis - the connection timeout in milliseconds
        Returns:
        the builder
      • headerTransform

        public HttpConfigurationBuilder headerTransform​(LDHeaderUpdater headerTransform)
        Provides a callback for dynamically modifying headers used on requests to LaunchDarkly services.
        Parameters:
        headerTransform - the transformation to apply to requests
        Returns:
        the builder
      • useReport

        public HttpConfigurationBuilder useReport​(boolean useReport)
        Sets whether to use the HTTP REPORT method for feature flag requests.

        By default, polling and streaming connections are made with the GET method, with the context data encoded into the request URI. Using REPORT allows the user data to be sent in the request body instead, which is somewhat more secure and efficient.

        However, the REPORT method is not always supported by operating systems or network gateways. Therefore it is disabled in the SDK by default. You can enable it if you know your code will not be running in an environment that disallows REPORT.

        Parameters:
        useReport - true to enable the REPORT method
        Returns:
        the builder
      • wrapper

        public HttpConfigurationBuilder wrapper​(java.lang.String wrapperName,
                                                java.lang.String wrapperVersion)
        For use by wrapper libraries to set an identifying name for the wrapper being used. This will be included in a header during requests to the LaunchDarkly servers to allow recording metrics on the usage of these wrapper libraries.
        Parameters:
        wrapperName - an identifying name for the wrapper library
        wrapperVersion - version string for the wrapper library
        Returns:
        the builder