Package com.databricks.jdbc.dbclient.impl.common

## Class ConfiguratorUtils

- java.lang.Object
- - com.databricks.jdbc.dbclient.impl.common.ConfiguratorUtils

    public class ConfiguratorUtils
    extends Object

This class contains the utility functions for configuring a client.

### Constructor Summary

Constructors
`ConfiguratorUtils()`

### Method Summary

All Methods Static Methods Concrete Methods
`static CertPathTrustManagerParameters` `buildTrustManagerParameters​(Set<TrustAnchor> trustAnchors, boolean checkCertificateRevocation, boolean acceptUndeterminedCertificateRevocation)`
`static org.apache.http.impl.conn.PoolingHttpClientConnectionManager` `getBaseConnectionManager​(IDatabricksConnectionContext connectionContext)`
`static org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory>` `getConnectionSocketFactoryRegistry​(IDatabricksConnectionContext connectionContext)` This function returns the registry of connection socket factories based on the truststore and properties set in the connection context.
`static Set<TrustAnchor>` `getTrustAnchorsFromTrustStore​(KeyStore trustStore)`
`static KeyStore` `loadTruststoreOrNull​(IDatabricksConnectionContext connectionContext)`

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

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

### Constructor Detail

#### ConfiguratorUtils

    public ConfiguratorUtils()

### Method Detail

#### getBaseConnectionManager

    public static org.apache.http.impl.conn.PoolingHttpClientConnectionManager getBaseConnectionManager​(IDatabricksConnectionContext connectionContext)

Parameters:
  `connectionContext` - The connection context to use to get the truststore and properties.
Returns:
  The connection manager based on the truststore and properties set in the connection

#### getConnectionSocketFactoryRegistry

    public static org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory> getConnectionSocketFactoryRegistry​(IDatabricksConnectionContext connectionContext)

This function returns the registry of connection socket factories based on the truststore and properties set in the connection context.

Parameters:
  `connectionContext` - The connection context to use to get the truststore, certificate revocation settings.
Returns:
  The registry of connection socket factories.

#### loadTruststoreOrNull

    public static KeyStore loadTruststoreOrNull​(IDatabricksConnectionContext connectionContext)

Parameters:
  `connectionContext` - The connection context to use to get the truststore.
Returns:
  The truststore loaded from the connection context or null if the truststore is not set.

#### buildTrustManagerParameters

    public static CertPathTrustManagerParameters buildTrustManagerParameters​(Set<TrustAnchor> trustAnchors,
                                                                             boolean checkCertificateRevocation,
                                                                             boolean acceptUndeterminedCertificateRevocation)

Parameters:
  `trustAnchors` - The trust anchors to use in the trust manager.
  `checkCertificateRevocation` - Whether to check certificate revocation.
  `acceptUndeterminedCertificateRevocation` - Whether to accept undetermined certificate
Returns:
  The trust manager parameters based on the input parameters.

#### getTrustAnchorsFromTrustStore

    public static Set<TrustAnchor> getTrustAnchorsFromTrustStore​(KeyStore trustStore)

Parameters:
  `trustStore` - The trust store from which to get the trust anchors.
Returns:
  The set of trust anchors from the trust store.