Class ConfiguratorUtils


  • public class ConfiguratorUtils
    extends Object
    This class contains the utility functions for configuring a client.
    • 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.