org.keycloak.connections.httpclient

## Class HttpClientBuilder

- java.lang.Object
- - org.keycloak.connections.httpclient.HttpClientBuilder

-     public class HttpClientBuilder
      extends Object

  Abstraction for creating HttpClients. Allows SSL configuration.
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `HttpClientBuilder.HostnameVerificationPolicy`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected KeyStore` | `clientKeyStore`
    `protected String` | `clientPrivateKeyPassword`
    `protected int` | `connectionPoolSize`
    `protected long` | `connectionTTL`
    `protected TimeUnit` | `connectionTTLUnit`
    `protected boolean` | `disableCookies`
    `protected boolean` | `disableTrustManager`
    `protected long` | `establishConnectionTimeout`
    `protected TimeUnit` | `establishConnectionTimeoutUnits`
    `protected long` | `maxConnectionIdleTime`
    `protected TimeUnit` | `maxConnectionIdleTimeUnit`
    `protected int` | `maxPooledPerRoute`
    `protected HttpClientBuilder.HostnameVerificationPolicy` | `policy`
    `protected long` | `socketTimeout`
    `protected TimeUnit` | `socketTimeoutUnits`
    `protected SSLContext` | `sslContext`
    `protected KeyStore` | `truststore`
    `protected HostnameVerifier` | `verifier`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HttpClientBuilder()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.apache.http.impl.client.CloseableHttpClient` | `build()`
    `HttpClientBuilder` | `connectionPoolSize(int connectionPoolSize)`
    `HttpClientBuilder` | `connectionTTL(long ttl, TimeUnit unit)`
    `HttpClientBuilder` | `disableCookies(boolean disable)` Disable cookie management.
    `HttpClientBuilder` | `disableTrustManager()` Disable trust management and hostname verification.
    `HttpClientBuilder` | `establishConnectionTimeout(long timeout, TimeUnit unit)` When trying to make an initial socket connection, what is the timeout?
    `HttpClientBuilder` | `hostnameVerification(HttpClientBuilder.HostnameVerificationPolicy policy)` SSL policy used to verify hostnames
    `HttpClientBuilder` | `keyStore(KeyStore keyStore, char[] password)`
    `HttpClientBuilder` | `keyStore(KeyStore keyStore, String password)`
    `HttpClientBuilder` | `maxConnectionIdleTime(long maxConnectionIdleTime, TimeUnit unit)`
    `HttpClientBuilder` | `maxPooledPerRoute(int maxPooledPerRoute)`
    `HttpClientBuilder` | `socketTimeout(long timeout, TimeUnit unit)` Socket inactivity timeout
    `HttpClientBuilder` | `sslContext(SSLContext sslContext)`
    `HttpClientBuilder` | `trustStore(KeyStore truststore)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### truststore

          protected KeyStore truststore

    - #### clientKeyStore

          protected KeyStore clientKeyStore

    - #### clientPrivateKeyPassword

          protected String clientPrivateKeyPassword

    - #### disableTrustManager

          protected boolean disableTrustManager

    - #### policy

          protected HttpClientBuilder.HostnameVerificationPolicy policy

    - #### sslContext

          protected SSLContext sslContext

    - #### connectionPoolSize

          protected int connectionPoolSize

    - #### maxPooledPerRoute

          protected int maxPooledPerRoute

    - #### connectionTTL

          protected long connectionTTL

    - #### connectionTTLUnit

          protected TimeUnit connectionTTLUnit

    - #### maxConnectionIdleTime

          protected long maxConnectionIdleTime

    - #### maxConnectionIdleTimeUnit

          protected TimeUnit maxConnectionIdleTimeUnit

    - #### verifier

          protected HostnameVerifier verifier

    - #### socketTimeout

          protected long socketTimeout

    - #### socketTimeoutUnits

          protected TimeUnit socketTimeoutUnits

    - #### establishConnectionTimeout

          protected long establishConnectionTimeout

    - #### establishConnectionTimeoutUnits

          protected TimeUnit establishConnectionTimeoutUnits

    - #### disableCookies

          protected boolean disableCookies

  - ### Constructor Detail

    - #### HttpClientBuilder

          public HttpClientBuilder()

  - ### Method Detail

    - #### socketTimeout

          public HttpClientBuilder socketTimeout(long timeout,
                                                 TimeUnit unit)

      Socket inactivity timeout
      Parameters:
        `timeout` -
        `unit` -
      Returns:

    - #### establishConnectionTimeout

          public HttpClientBuilder establishConnectionTimeout(long timeout,
                                                              TimeUnit unit)

      When trying to make an initial socket connection, what is the timeout?
      Parameters:
        `timeout` -
        `unit` -
      Returns:

    - #### connectionTTL

          public HttpClientBuilder connectionTTL(long ttl,
                                                 TimeUnit unit)

    - #### maxConnectionIdleTime

          public HttpClientBuilder maxConnectionIdleTime(long maxConnectionIdleTime,
                                                         TimeUnit unit)

    - #### maxPooledPerRoute

          public HttpClientBuilder maxPooledPerRoute(int maxPooledPerRoute)

    - #### connectionPoolSize

          public HttpClientBuilder connectionPoolSize(int connectionPoolSize)

    - #### disableTrustManager

          public HttpClientBuilder disableTrustManager()

      Disable trust management and hostname verification. NOTE this is a security hole, so only set this option if you cannot or do not want to verify the identity of the host you are communicating with.

    - #### disableCookies

          public HttpClientBuilder disableCookies(boolean disable)

      Disable cookie management.

    - #### hostnameVerification

          public HttpClientBuilder hostnameVerification(HttpClientBuilder.HostnameVerificationPolicy policy)

      SSL policy used to verify hostnames
      Parameters:
        `policy` -
      Returns:

    - #### sslContext

          public HttpClientBuilder sslContext(SSLContext sslContext)

    - #### trustStore

          public HttpClientBuilder trustStore(KeyStore truststore)

    - #### keyStore

          public HttpClientBuilder keyStore(KeyStore keyStore,
                                            String password)

    - #### keyStore

          public HttpClientBuilder keyStore(KeyStore keyStore,
                                            char[] password)

    - #### build

          public org.apache.http.impl.client.CloseableHttpClient build()

Copyright © 2016 JBoss by Red Hat. All rights reserved.