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();
Note that this class is abstract; the actual implementation is created by calling Components.httpConfiguration()
.
Modifier and Type | Field and Description |
---|---|
protected java.time.Duration |
connectTimeout |
static java.time.Duration |
DEFAULT_CONNECT_TIMEOUT
The default value for
connectTimeout(Duration) : two seconds. |
static java.time.Duration |
DEFAULT_SOCKET_TIMEOUT
The default value for
socketTimeout(Duration) : 10 seconds. |
protected HttpAuthentication |
proxyAuth |
protected java.lang.String |
proxyHost |
protected int |
proxyPort |
protected java.time.Duration |
socketTimeout |
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 |
connectTimeout(java.time.Duration connectTimeout)
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 |
socketTimeout(java.time.Duration socketTimeout)
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 java.time.Duration DEFAULT_CONNECT_TIMEOUT
connectTimeout(Duration)
: two seconds.public static final java.time.Duration DEFAULT_SOCKET_TIMEOUT
socketTimeout(Duration)
: 10 seconds.protected java.time.Duration connectTimeout
protected HttpAuthentication proxyAuth
protected java.lang.String proxyHost
protected int proxyPort
protected java.time.Duration socketTimeout
protected javax.net.ssl.SSLSocketFactory sslSocketFactory
protected javax.net.ssl.X509TrustManager trustManager
protected java.lang.String wrapperName
protected java.lang.String wrapperVersion
public HttpConfigurationBuilder connectTimeout(java.time.Duration connectTimeout)
The default is DEFAULT_CONNECT_TIMEOUT
.
connectTimeout
- the connection timeout; null to use the defaultpublic 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 socketTimeout(java.time.Duration socketTimeout)
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
.
socketTimeout
- the socket timeout; null to use the defaultpublic 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