com.launchdarkly.sdk.server.HttpConfigurationImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of launchdarkly-java-server-sdk Show documentation
Show all versions of launchdarkly-java-server-sdk Show documentation
Official LaunchDarkly SDK for Java
package com.launchdarkly.sdk.server;
import com.google.common.collect.ImmutableMap;
import com.launchdarkly.sdk.server.interfaces.HttpAuthentication;
import com.launchdarkly.sdk.server.interfaces.HttpConfiguration;
import java.net.Proxy;
import java.time.Duration;
import java.util.Map;
import javax.net.SocketFactory;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;
final class HttpConfigurationImpl implements HttpConfiguration {
final Duration connectTimeout;
final Proxy proxy;
final HttpAuthentication proxyAuth;
final Duration socketTimeout;
final SocketFactory socketFactory;
final SSLSocketFactory sslSocketFactory;
final X509TrustManager trustManager;
final ImmutableMap defaultHeaders;
HttpConfigurationImpl(Duration connectTimeout, Proxy proxy, HttpAuthentication proxyAuth,
Duration socketTimeout, SocketFactory socketFactory,
SSLSocketFactory sslSocketFactory, X509TrustManager trustManager,
ImmutableMap defaultHeaders) {
this.connectTimeout = connectTimeout;
this.proxy = proxy;
this.proxyAuth = proxyAuth;
this.socketTimeout = socketTimeout;
this.socketFactory = socketFactory;
this.sslSocketFactory = sslSocketFactory;
this.trustManager = trustManager;
this.defaultHeaders = defaultHeaders;
}
@Override
public Duration getConnectTimeout() {
return connectTimeout;
}
@Override
public Proxy getProxy() {
return proxy;
}
@Override
public HttpAuthentication getProxyAuthentication() {
return proxyAuth;
}
@Override
public Duration getSocketTimeout() {
return socketTimeout;
}
@Override
public SocketFactory getSocketFactory() {
return socketFactory;
}
@Override
public SSLSocketFactory getSslSocketFactory() {
return sslSocketFactory;
}
@Override
public X509TrustManager getTrustManager() {
return trustManager;
}
@Override
public Iterable> getDefaultHeaders() {
return defaultHeaders.entrySet();
}
}