All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.launchdarkly.sdk.server.HttpConfigurationImpl Maven / Gradle / Ivy

There is a newer version: 7.5.0
Show newest version
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();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy