public abstract class HttpConfigurationBuilder extends java.lang.Object implements HttpConfigurationFactory
If you want to set non-default values for any of these properties, create a builder with
Components.httpConfiguration()
, change its properties with the methods of this class,
and pass it to LDConfig.Builder.http(HttpConfigurationFactory)
:
LDConfig config = new LDConfig.Builder()
.http(
Components.httpConfiguration()
.connectTimeoutMillis(3000)
.proxyHostAndPort("my-proxy", 8080)
)
.build();
These properties will override any equivalent deprecated properties that were set with LDConfig.Builder
,
such as LDConfig.Builder.connectTimeoutMillis(int)
.
Note that this class is abstract; the actual implementation is created by calling Components.httpConfiguration()
.
Modifier and Type | Field and Description |
---|---|
protected int |
connectTimeoutMillis |
static int |
DEFAULT_CONNECT_TIMEOUT_MILLIS
The default value for
connectTimeoutMillis(int) . |
static int |
DEFAULT_SOCKET_TIMEOUT_MILLIS
The default value for
socketTimeoutMillis(int) . |
protected HttpAuthentication |
proxyAuth |
protected java.lang.String |
proxyHost |
protected int |
proxyPort |
protected int |
socketTimeoutMillis |
protected javax.net.ssl.SSLSocketFactory |
sslSocketFactory |
protected javax.net.ssl.X509TrustManager |
trustManager |
protected java.lang.String |
wrapperName |
protected java.lang.String |
wrapperVersion |
Constructor and Description |
---|
HttpConfigurationBuilder() |
Modifier and Type | Method and Description |
---|---|
HttpConfigurationBuilder |
connectTimeoutMillis(int connectTimeoutMillis)
Sets the connection timeout.
|
HttpConfigurationBuilder |
proxyAuth(HttpAuthentication strategy)
Sets an authentication strategy for use with an HTTP proxy.
|
HttpConfigurationBuilder |
proxyHostAndPort(java.lang.String host,
int port)
Sets an HTTP proxy for making connections to LaunchDarkly.
|
HttpConfigurationBuilder |
socketTimeoutMillis(int socketTimeoutMillis)
Sets the socket timeout.
|
HttpConfigurationBuilder |
sslSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory,
javax.net.ssl.X509TrustManager trustManager)
Specifies a custom security configuration for HTTPS connections to LaunchDarkly.
|
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createHttpConfiguration
public static final int DEFAULT_CONNECT_TIMEOUT_MILLIS
connectTimeoutMillis(int)
.public static final int DEFAULT_SOCKET_TIMEOUT_MILLIS
socketTimeoutMillis(int)
.protected int connectTimeoutMillis
protected HttpAuthentication proxyAuth
protected java.lang.String proxyHost
protected int proxyPort
protected int socketTimeoutMillis
protected javax.net.ssl.SSLSocketFactory sslSocketFactory
protected javax.net.ssl.X509TrustManager trustManager
protected java.lang.String wrapperName
protected java.lang.String wrapperVersion
public HttpConfigurationBuilder connectTimeoutMillis(int connectTimeoutMillis)
The default is DEFAULT_CONNECT_TIMEOUT_MILLIS
.
connectTimeoutMillis
- the connection timeout, in millisecondspublic HttpConfigurationBuilder proxyHostAndPort(java.lang.String host, int port)
host
- the proxy hostnameport
- the proxy portpublic HttpConfigurationBuilder proxyAuth(HttpAuthentication strategy)
proxyHostAndPort(String, int)
.strategy
- the authentication strategypublic HttpConfigurationBuilder socketTimeoutMillis(int socketTimeoutMillis)
Components.streamingDataSource()
, which has its own
non-configurable read timeout based on the expected behavior of the LaunchDarkly streaming service.
The default is DEFAULT_SOCKET_TIMEOUT_MILLIS
.
socketTimeoutMillis
- the socket timeout, in millisecondspublic HttpConfigurationBuilder sslSocketFactory(javax.net.ssl.SSLSocketFactory sslSocketFactory, javax.net.ssl.X509TrustManager trustManager)
This uses the standard Java interfaces for configuring secure socket connections and certificate verification.
sslSocketFactory
- the SSL socket factorytrustManager
- the trust managerpublic HttpConfigurationBuilder wrapper(java.lang.String wrapperName, java.lang.String wrapperVersion)
wrapperName
- an identifying name for the wrapper librarywrapperVersion
- version string for the wrapper library