Class ArrowFlightSqlClientHandler.Builder
java.lang.Object
org.apache.arrow.driver.jdbc.client.ArrowFlightSqlClientHandler.Builder
- Enclosing class:
- ArrowFlightSqlClientHandler
Builder for
ArrowFlightSqlClientHandler
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newArrowFlightSqlClientHandler
from the provided fields.withBufferAllocator
(BufferAllocator allocator) Sets theBufferAllocator
to use in this handler.withCallOptions
(Collection<CallOption> options) Adds the providedCallOption
s to this handler.withCallOptions
(CallOption... options) Adds the providedCallOption
s to this handler.withCatalog
(String catalog) Sets the catalog for this handler if it is not null.withClientCertificate
(String clientCertificatePath) Sets the mTLS client certificate path (if mTLS is required).withClientKey
(String clientKeyPath) Sets the mTLS client certificate private key path (if mTLS is required).withDisableCertificateVerification
(boolean disableCertificateVerification) Sets whether to disable the certificate verification in this handler.withEncryption
(boolean useEncryption) Sets whether to use TLS encryption in this handler.Sets the host for this handler.Adds the providedfactories
to the list ofmiddlewareFactories
of this handler.withMiddlewareFactories
(FlightClientMiddleware.Factory... factories) Adds the providedfactories
to the list ofmiddlewareFactories
of this handler.withPassword
(String password) Sets the password for this handler.withPort
(int port) Sets the port for this handler.withRetainAuth
(boolean retainAuth) Indicates if bearer tokens negotiated should be re-used by connections spawned for getStreams() calls.withRetainCookies
(boolean retainCookies) Indicates if cookies should be re-used by connections spawned for getStreams() calls.withSystemTrustStore
(boolean useSystemTrustStore) Sets whether to use the certificates from the operating system.withTlsRootCertificates
(String tlsRootCertificatesPath) Sets the TLS root certificate path as an alternative to using the System or other Trust Store.Sets the token used in the token authentication.withTrustStorePassword
(String trustStorePassword) Sets the KeyStore password for this handler.withTrustStorePath
(String trustStorePath) Sets the KeyStore path for this handler.withUsername
(String username) Sets the username for this handler.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
withHost
Sets the host for this handler.- Parameters:
host
- the host.- Returns:
- this instance.
-
withPort
Sets the port for this handler.- Parameters:
port
- the port.- Returns:
- this instance.
-
withUsername
Sets the username for this handler.- Parameters:
username
- the username.- Returns:
- this instance.
-
withPassword
Sets the password for this handler.- Parameters:
password
- the password.- Returns:
- this instance.
-
withTrustStorePath
Sets the KeyStore path for this handler.- Parameters:
trustStorePath
- the KeyStore path.- Returns:
- this instance.
-
withTrustStorePassword
Sets the KeyStore password for this handler.- Parameters:
trustStorePassword
- the KeyStore password.- Returns:
- this instance.
-
withEncryption
Sets whether to use TLS encryption in this handler.- Parameters:
useEncryption
- whether to use TLS encryption.- Returns:
- this instance.
-
withDisableCertificateVerification
public ArrowFlightSqlClientHandler.Builder withDisableCertificateVerification(boolean disableCertificateVerification) Sets whether to disable the certificate verification in this handler.- Parameters:
disableCertificateVerification
- whether to disable certificate verification.- Returns:
- this instance.
-
withSystemTrustStore
Sets whether to use the certificates from the operating system.- Parameters:
useSystemTrustStore
- whether to use the system operating certificates.- Returns:
- this instance.
-
withTlsRootCertificates
Sets the TLS root certificate path as an alternative to using the System or other Trust Store. The path must contain a valid PEM file.- Parameters:
tlsRootCertificatesPath
- the TLS root certificate path (if TLS is required).- Returns:
- this instance.
-
withClientCertificate
Sets the mTLS client certificate path (if mTLS is required).- Parameters:
clientCertificatePath
- the mTLS client certificate path (if mTLS is required).- Returns:
- this instance.
-
withClientKey
Sets the mTLS client certificate private key path (if mTLS is required).- Parameters:
clientKeyPath
- the mTLS client certificate private key path (if mTLS is required).- Returns:
- this instance.
-
withToken
Sets the token used in the token authentication.- Parameters:
token
- the token value.- Returns:
- this builder instance.
-
withBufferAllocator
Sets theBufferAllocator
to use in this handler.- Parameters:
allocator
- the allocator.- Returns:
- this instance.
-
withRetainCookies
Indicates if cookies should be re-used by connections spawned for getStreams() calls.- Parameters:
retainCookies
- The flag indicating if cookies should be re-used.- Returns:
- this builder instance.
-
withRetainAuth
Indicates if bearer tokens negotiated should be re-used by connections spawned for getStreams() calls.- Parameters:
retainAuth
- The flag indicating if auth tokens should be re-used.- Returns:
- this builder instance.
-
withMiddlewareFactories
public ArrowFlightSqlClientHandler.Builder withMiddlewareFactories(FlightClientMiddleware.Factory... factories) Adds the providedfactories
to the list ofmiddlewareFactories
of this handler.- Parameters:
factories
- the factories to add.- Returns:
- this instance.
-
withMiddlewareFactories
public ArrowFlightSqlClientHandler.Builder withMiddlewareFactories(Collection<FlightClientMiddleware.Factory> factories) Adds the providedfactories
to the list ofmiddlewareFactories
of this handler.- Parameters:
factories
- the factories to add.- Returns:
- this instance.
-
withCallOptions
Adds the providedCallOption
s to this handler.- Parameters:
options
- the options- Returns:
- this instance.
-
withCallOptions
Adds the providedCallOption
s to this handler.- Parameters:
options
- the options- Returns:
- this instance.
-
withCatalog
Sets the catalog for this handler if it is not null.- Parameters:
catalog
- the catalog- Returns:
- this instance.
-
build
Builds a newArrowFlightSqlClientHandler
from the provided fields.- Returns:
- a new client handler.
- Throws:
SQLException
- on error.
-