Package com.databricks.jdbc.api.impl

## Class DatabricksConnectionContext

- java.lang.Object
- - com.databricks.jdbc.api.impl.DatabricksConnectionContext

All Implemented Interfaces:
  `IDatabricksConnectionContext`

    public class DatabricksConnectionContext
    extends Object
    implements IDatabricksConnectionContext

### Nested Class Summary

### Nested classes/interfaces inherited from interface com.databricks.jdbc.api.IDatabricksConnectionContext

`IDatabricksConnectionContext.AuthFlow, IDatabricksConnectionContext.AuthMech, IDatabricksConnectionContext.Cloud`

### Field Summary

Fields
`static JdbcLogger` `LOGGER`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `enableTelemetry()`
`boolean` `equals​(Object obj)`
`int` `getAsyncExecPollInterval()`
`String` `getAuthEndpoint()` Returns the OAuth2 authorization endpoint URL for the authorization code flow.
`IDatabricksConnectionContext.AuthFlow` `getAuthFlow()`
`IDatabricksConnectionContext.AuthMech` `getAuthMech()`
`String` `getAuthScope()` Returns the OAuth2 authentication scope used in the request.
`String` `getCatalog()`
`String` `getClientId()`
`String` `getClientSecret()`
`DatabricksClientType` `getClientType()`
`String` `getClientUserAgent()`
`IDatabricksConnectionContext.Cloud` `getCloud()`
`com.databricks.sdk.core.ProxyConfig.ProxyAuthType` `getCloudFetchProxyAuthType()`
`String` `getCloudFetchProxyHost()`
`String` `getCloudFetchProxyPassword()`
`int` `getCloudFetchProxyPort()`
`String` `getCloudFetchProxyUser()`
`int` `getCloudFetchThreadPoolSize()` Returns the number of threads to be used for fetching data from cloud storage
`CompressionType` `getCompressionType()`
`IDatabricksComputeResource` `getComputeResource()` Returns warehouse-Id as parsed from JDBC connection Url
`String` `getConnectionURL()`
`Boolean` `getDirectResultMode()`
`String` `getEndpointURL()`
`String` `getHostForOAuth()`
`String` `getHostUrl()` Returns host-Url for Databricks server as parsed from JDBC connection in format `https://server:port`
`String` `getHttpPath()`
`int` `getIdleHttpConnectionExpiry()`
`String` `getJWTAlgorithm()` Returns the algorithm used for signing the JWT (e.g., RS256, ES256).
`String` `getJWTKeyFile()` Returns the file path to the JWT private key used for signing the JWT.
`String` `getJWTPassphrase()` Returns the passphrase to decrypt the private key if the key is encrypted.
`String` `getKID()` Returns the Key ID (KID) used in the JWT header, identifying the key.
`int` `getLogFileCount()`
`int` `getLogFileSize()`
`LogLevel` `getLogLevel()`
`String` `getLogPathString()`
`DatabricksMetrics` `getMetricsExporter()`
`String` `getOAuthDiscoveryURL()` Returns the discovery URL used to obtain the OAuth2 token and authorization endpoints.
`String` `getOAuthRefreshToken()`
`List<String>` `getOAuthScopesForU2M()`
`String` `getPassThroughAccessToken()` Returns the pass through access token
`com.databricks.sdk.core.ProxyConfig.ProxyAuthType` `getProxyAuthType()`
`String` `getProxyHost()`
`String` `getProxyPassword()`
`int` `getProxyPort()`
`String` `getProxyUser()`
`int` `getRateLimitRetryTimeout()`
`String` `getSchema()`
`Map<String,​String>` `getSessionConfigs()`
`int` `getTemporarilyUnavailableRetryTimeout()`
`String` `getToken()` Returns the auth token (personal access token)
`String` `getTokenEndpoint()` Returns the OAuth2 token endpoint URL for retrieving tokens.
`Boolean` `getUseCloudFetchProxy()`
`Boolean` `getUseLegacyMetadata()`
`Boolean` `getUseProxy()`
`Boolean` `getUseSystemProxy()`
`int` `hashCode()`
`boolean` `isAllPurposeCluster()`
`boolean` `isFakeServiceTest()` Returns whether the current test is a fake service test.
`boolean` `isOAuthDiscoveryModeEnabled()` Returns whether OAuth2 discovery mode is enabled, which fetches endpoints dynamically.
`Boolean` `shouldEnableArrow()`
`Boolean` `shouldRetryRateLimitError()`
`Boolean` `shouldRetryTemporarilyUnavailableError()`
`boolean` `supportManyParameters()`
`boolean` `useJWTAssertion()` Returns whether JWT assertion should be used for OAuth2 authentication.

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

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

### Field Detail

#### LOGGER

    public static final JdbcLogger LOGGER

### Method Detail

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals​(Object obj)

Overrides:
  `equals` in class `Object`

#### getMetricsExporter

    public DatabricksMetrics getMetricsExporter()

Specified by:
  `getMetricsExporter` in interface `IDatabricksConnectionContext`

#### getHostUrl

    public String getHostUrl()
                      throws DatabricksParsingException

Description copied from interface: `IDatabricksConnectionContext`
Returns host-Url for Databricks server as parsed from JDBC connection in format `https://server:port`

Specified by:
  `getHostUrl` in interface `IDatabricksConnectionContext`
Returns:
  Databricks host-Url
Throws:
  `DatabricksParsingException`

#### getComputeResource

    public IDatabricksComputeResource getComputeResource()

Description copied from interface: `IDatabricksConnectionContext`
Returns warehouse-Id as parsed from JDBC connection Url

Specified by:
  `getComputeResource` in interface `IDatabricksConnectionContext`
Returns:
  warehouse-Id

#### getHttpPath

    public String getHttpPath()

Specified by:
  `getHttpPath` in interface `IDatabricksConnectionContext`

#### getHostForOAuth

    public String getHostForOAuth()

Specified by:
  `getHostForOAuth` in interface `IDatabricksConnectionContext`

#### getToken

    public String getToken()

Description copied from interface: `IDatabricksConnectionContext`
Returns the auth token (personal access token)

Specified by:
  `getToken` in interface `IDatabricksConnectionContext`
Returns:
  auth token

#### getPassThroughAccessToken

    public String getPassThroughAccessToken()

Description copied from interface: `IDatabricksConnectionContext`
Returns the pass through access token

Specified by:
  `getPassThroughAccessToken` in interface `IDatabricksConnectionContext`
Returns:
  access token

#### getAsyncExecPollInterval

    public int getAsyncExecPollInterval()

Specified by:
  `getAsyncExecPollInterval` in interface `IDatabricksConnectionContext`

#### getDirectResultMode

    public Boolean getDirectResultMode()

Specified by:
  `getDirectResultMode` in interface `IDatabricksConnectionContext`

#### getCloud

    public IDatabricksConnectionContext.Cloud getCloud()
                                                throws DatabricksParsingException

Throws:
  `DatabricksParsingException`

#### getClientId

    public String getClientId()
                       throws DatabricksParsingException

Specified by:
  `getClientId` in interface `IDatabricksConnectionContext`
Throws:
  `DatabricksParsingException`

#### getOAuthScopesForU2M

    public List<String> getOAuthScopesForU2M()
                                      throws DatabricksParsingException

Specified by:
  `getOAuthScopesForU2M` in interface `IDatabricksConnectionContext`
Throws:
  `DatabricksParsingException`

#### getClientSecret

    public String getClientSecret()

Specified by:
  `getClientSecret` in interface `IDatabricksConnectionContext`

#### getAuthFlow

    public IDatabricksConnectionContext.AuthFlow getAuthFlow()

Specified by:
  `getAuthFlow` in interface `IDatabricksConnectionContext`

#### getAuthMech

    public IDatabricksConnectionContext.AuthMech getAuthMech()

Specified by:
  `getAuthMech` in interface `IDatabricksConnectionContext`

#### getLogLevel

    public LogLevel getLogLevel()

Specified by:
  `getLogLevel` in interface `IDatabricksConnectionContext`

#### getLogPathString

    public String getLogPathString()

Specified by:
  `getLogPathString` in interface `IDatabricksConnectionContext`

#### getLogFileSize

    public int getLogFileSize()

Specified by:
  `getLogFileSize` in interface `IDatabricksConnectionContext`

#### getLogFileCount

    public int getLogFileCount()

Specified by:
  `getLogFileCount` in interface `IDatabricksConnectionContext`

#### getClientUserAgent

    public String getClientUserAgent()

Specified by:
  `getClientUserAgent` in interface `IDatabricksConnectionContext`

#### getCompressionType

    public CompressionType getCompressionType()

Specified by:
  `getCompressionType` in interface `IDatabricksConnectionContext`

#### getClientType

    public DatabricksClientType getClientType()

Specified by:
  `getClientType` in interface `IDatabricksConnectionContext`

#### getUseLegacyMetadata

    public Boolean getUseLegacyMetadata()

Specified by:
  `getUseLegacyMetadata` in interface `IDatabricksConnectionContext`

#### getCloudFetchThreadPoolSize

    public int getCloudFetchThreadPoolSize()

Description copied from interface: `IDatabricksConnectionContext`
Returns the number of threads to be used for fetching data from cloud storage

Specified by:
  `getCloudFetchThreadPoolSize` in interface `IDatabricksConnectionContext`

#### getCatalog

    public String getCatalog()

Specified by:
  `getCatalog` in interface `IDatabricksConnectionContext`

#### getSchema

    public String getSchema()

Specified by:
  `getSchema` in interface `IDatabricksConnectionContext`

#### getSessionConfigs

    public Map<String,​String> getSessionConfigs()

Specified by:
  `getSessionConfigs` in interface `IDatabricksConnectionContext`

#### isAllPurposeCluster

    public boolean isAllPurposeCluster()

Specified by:
  `isAllPurposeCluster` in interface `IDatabricksConnectionContext`

#### getProxyHost

    public String getProxyHost()

Specified by:
  `getProxyHost` in interface `IDatabricksConnectionContext`

#### getProxyPort

    public int getProxyPort()

Specified by:
  `getProxyPort` in interface `IDatabricksConnectionContext`

#### getProxyUser

    public String getProxyUser()

Specified by:
  `getProxyUser` in interface `IDatabricksConnectionContext`

#### getProxyPassword

    public String getProxyPassword()

Specified by:
  `getProxyPassword` in interface `IDatabricksConnectionContext`

#### getUseProxy

    public Boolean getUseProxy()

Specified by:
  `getUseProxy` in interface `IDatabricksConnectionContext`

#### getProxyAuthType

    public com.databricks.sdk.core.ProxyConfig.ProxyAuthType getProxyAuthType()

Specified by:
  `getProxyAuthType` in interface `IDatabricksConnectionContext`

#### getUseSystemProxy

    public Boolean getUseSystemProxy()

Specified by:
  `getUseSystemProxy` in interface `IDatabricksConnectionContext`

#### getUseCloudFetchProxy

    public Boolean getUseCloudFetchProxy()

Specified by:
  `getUseCloudFetchProxy` in interface `IDatabricksConnectionContext`

#### getCloudFetchProxyHost

    public String getCloudFetchProxyHost()

Specified by:
  `getCloudFetchProxyHost` in interface `IDatabricksConnectionContext`

#### getCloudFetchProxyPort

    public int getCloudFetchProxyPort()

Specified by:
  `getCloudFetchProxyPort` in interface `IDatabricksConnectionContext`

#### getCloudFetchProxyUser

    public String getCloudFetchProxyUser()

Specified by:
  `getCloudFetchProxyUser` in interface `IDatabricksConnectionContext`

#### getCloudFetchProxyPassword

    public String getCloudFetchProxyPassword()

Specified by:
  `getCloudFetchProxyPassword` in interface `IDatabricksConnectionContext`

#### getCloudFetchProxyAuthType

    public com.databricks.sdk.core.ProxyConfig.ProxyAuthType getCloudFetchProxyAuthType()

Specified by:
  `getCloudFetchProxyAuthType` in interface `IDatabricksConnectionContext`

#### shouldEnableArrow

    public Boolean shouldEnableArrow()

Specified by:
  `shouldEnableArrow` in interface `IDatabricksConnectionContext`

#### getEndpointURL

    public String getEndpointURL()
                          throws DatabricksParsingException

Specified by:
  `getEndpointURL` in interface `IDatabricksConnectionContext`
Throws:
  `DatabricksParsingException`

#### shouldRetryTemporarilyUnavailableError

    public Boolean shouldRetryTemporarilyUnavailableError()

Specified by:
  `shouldRetryTemporarilyUnavailableError` in interface `IDatabricksConnectionContext`

#### shouldRetryRateLimitError

    public Boolean shouldRetryRateLimitError()

Specified by:
  `shouldRetryRateLimitError` in interface `IDatabricksConnectionContext`

#### getTemporarilyUnavailableRetryTimeout

    public int getTemporarilyUnavailableRetryTimeout()

Specified by:
  `getTemporarilyUnavailableRetryTimeout` in interface `IDatabricksConnectionContext`

#### getRateLimitRetryTimeout

    public int getRateLimitRetryTimeout()

Specified by:
  `getRateLimitRetryTimeout` in interface `IDatabricksConnectionContext`

#### getIdleHttpConnectionExpiry

    public int getIdleHttpConnectionExpiry()

Specified by:
  `getIdleHttpConnectionExpiry` in interface `IDatabricksConnectionContext`

#### supportManyParameters

    public boolean supportManyParameters()

Specified by:
  `supportManyParameters` in interface `IDatabricksConnectionContext`

#### isFakeServiceTest

    public boolean isFakeServiceTest()

Returns whether the current test is a fake service test.

Specified by:
  `isFakeServiceTest` in interface `IDatabricksConnectionContext`

#### enableTelemetry

    public boolean enableTelemetry()

Specified by:
  `enableTelemetry` in interface `IDatabricksConnectionContext`

#### getConnectionURL

    public String getConnectionURL()

Specified by:
  `getConnectionURL` in interface `IDatabricksConnectionContext`

#### getJWTKeyFile

    public String getJWTKeyFile()

Description copied from interface: `IDatabricksConnectionContext`
Returns the file path to the JWT private key used for signing the JWT.

Specified by:
  `getJWTKeyFile` in interface `IDatabricksConnectionContext`

#### getKID

    public String getKID()

Description copied from interface: `IDatabricksConnectionContext`
Returns the Key ID (KID) used in the JWT header, identifying the key.

Specified by:
  `getKID` in interface `IDatabricksConnectionContext`

#### getJWTPassphrase

    public String getJWTPassphrase()

Description copied from interface: `IDatabricksConnectionContext`
Returns the passphrase to decrypt the private key if the key is encrypted.

Specified by:
  `getJWTPassphrase` in interface `IDatabricksConnectionContext`

#### getJWTAlgorithm

    public String getJWTAlgorithm()

Description copied from interface: `IDatabricksConnectionContext`
Returns the algorithm used for signing the JWT (e.g., RS256, ES256).

Specified by:
  `getJWTAlgorithm` in interface `IDatabricksConnectionContext`

#### useJWTAssertion

    public boolean useJWTAssertion()

Description copied from interface: `IDatabricksConnectionContext`
Returns whether JWT assertion should be used for OAuth2 authentication.

Specified by:
  `useJWTAssertion` in interface `IDatabricksConnectionContext`

#### getTokenEndpoint

    public String getTokenEndpoint()

Description copied from interface: `IDatabricksConnectionContext`
Returns the OAuth2 token endpoint URL for retrieving tokens.

Specified by:
  `getTokenEndpoint` in interface `IDatabricksConnectionContext`

#### getAuthEndpoint

    public String getAuthEndpoint()

Description copied from interface: `IDatabricksConnectionContext`
Returns the OAuth2 authorization endpoint URL for the authorization code flow.

Specified by:
  `getAuthEndpoint` in interface `IDatabricksConnectionContext`

#### isOAuthDiscoveryModeEnabled

    public boolean isOAuthDiscoveryModeEnabled()

Description copied from interface: `IDatabricksConnectionContext`
Returns whether OAuth2 discovery mode is enabled, which fetches endpoints dynamically.

Specified by:
  `isOAuthDiscoveryModeEnabled` in interface `IDatabricksConnectionContext`

#### getOAuthDiscoveryURL

    public String getOAuthDiscoveryURL()

Description copied from interface: `IDatabricksConnectionContext`
Returns the discovery URL used to obtain the OAuth2 token and authorization endpoints.

Specified by:
  `getOAuthDiscoveryURL` in interface `IDatabricksConnectionContext`

#### getAuthScope

    public String getAuthScope()

Description copied from interface: `IDatabricksConnectionContext`
Returns the OAuth2 authentication scope used in the request.

Specified by:
  `getAuthScope` in interface `IDatabricksConnectionContext`

#### getOAuthRefreshToken

    public String getOAuthRefreshToken()

Specified by:
  `getOAuthRefreshToken` in interface `IDatabricksConnectionContext`