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)` Builds trust manager parameters for certificate path validation including certificate revocation checking.
`static org.apache.http.config.Registry<org.apache.http.conn.socket.ConnectionSocketFactory>` `createConnectionSocketFactoryRegistry​(IDatabricksConnectionContext connectionContext)` Creates a registry of connection socket factories based on the connection context.
`static org.apache.http.impl.conn.PoolingHttpClientConnectionManager` `getBaseConnectionManager​(IDatabricksConnectionContext connectionContext)` Creates and configures the connection manager based on the connection context.
`static Set<TrustAnchor>` `getTrustAnchorsFromTrustStore​(KeyStore trustStore)` Extracts trust anchors from a KeyStore.
`static KeyStore` `loadTruststoreOrNull​(IDatabricksConnectionContext connectionContext)` Loads a trust store from the path specified in the connection context.

### 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)
                                                                                                 throws DatabricksHttpException

Creates and configures the connection manager based on the connection context.

Parameters:
  `connectionContext` - The connection context to use for configuration.
Returns:
  A configured PoolingHttpClientConnectionManager.
Throws:
  `DatabricksHttpException` - If there is an error during configuration.

#### createConnectionSocketFactoryRegistry

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

Creates a registry of connection socket factories based on the connection context.

Parameters:
  `connectionContext` - The connection context to use for configuration.
Returns:
  A configured Registry of ConnectionSocketFactory.
Throws:
  `DatabricksHttpException` - If there is an error during configuration.

#### loadTruststoreOrNull

    public static KeyStore loadTruststoreOrNull​(IDatabricksConnectionContext connectionContext)
                                         throws DatabricksHttpException

Loads a trust store from the path specified in the connection context.

Parameters:
  `connectionContext` - The connection context containing trust store configuration.
Returns:
  The loaded KeyStore or null if it could not be loaded.
Throws:
  `DatabricksHttpException` - If there is an error during loading.

#### getTrustAnchorsFromTrustStore

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

Extracts trust anchors from a KeyStore.

Parameters:
  `trustStore` - The KeyStore from which to extract trust anchors.
Returns:
  A Set of TrustAnchor objects extracted from the KeyStore.
Throws:
  `DatabricksHttpException` - If there is an error during extraction.

#### buildTrustManagerParameters

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

Builds trust manager parameters for certificate path validation including certificate revocation checking.

Parameters:
  `trustAnchors` - The trust anchors to use in the trust manager.
  `checkCertificateRevocation` - Whether to check certificate revocation.
  `acceptUndeterminedCertificateRevocation` - Whether to accept undetermined certificate revocation status.
Returns:
  The trust manager parameters based on the input parameters.
Throws:
  `DatabricksHttpException` - If there is an error during configuration.