Class ArrowFlightSqlClientHandler.Builder

java.lang.Object
org.apache.arrow.driver.jdbc.client.ArrowFlightSqlClientHandler.Builder
Enclosing class:
ArrowFlightSqlClientHandler

public static final class ArrowFlightSqlClientHandler.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • withHost

      Sets the host for this handler.
      Parameters:
      host - the host.
      Returns:
      this instance.
    • withPort

      public ArrowFlightSqlClientHandler.Builder withPort(int port)
      Sets the port for this handler.
      Parameters:
      port - the port.
      Returns:
      this instance.
    • withUsername

      public ArrowFlightSqlClientHandler.Builder withUsername(String username)
      Sets the username for this handler.
      Parameters:
      username - the username.
      Returns:
      this instance.
    • withPassword

      public ArrowFlightSqlClientHandler.Builder withPassword(String password)
      Sets the password for this handler.
      Parameters:
      password - the password.
      Returns:
      this instance.
    • withTrustStorePath

      public ArrowFlightSqlClientHandler.Builder withTrustStorePath(String trustStorePath)
      Sets the KeyStore path for this handler.
      Parameters:
      trustStorePath - the KeyStore path.
      Returns:
      this instance.
    • withTrustStorePassword

      public ArrowFlightSqlClientHandler.Builder withTrustStorePassword(String trustStorePassword)
      Sets the KeyStore password for this handler.
      Parameters:
      trustStorePassword - the KeyStore password.
      Returns:
      this instance.
    • withEncryption

      public ArrowFlightSqlClientHandler.Builder withEncryption(boolean useEncryption)
      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

      public ArrowFlightSqlClientHandler.Builder withSystemTrustStore(boolean useSystemTrustStore)
      Sets whether to use the certificates from the operating system.
      Parameters:
      useSystemTrustStore - whether to use the system operating certificates.
      Returns:
      this instance.
    • withTlsRootCertificates

      public ArrowFlightSqlClientHandler.Builder withTlsRootCertificates(String tlsRootCertificatesPath)
      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

      public ArrowFlightSqlClientHandler.Builder withClientCertificate(String clientCertificatePath)
      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

      public ArrowFlightSqlClientHandler.Builder withClientKey(String clientKeyPath)
      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

      public ArrowFlightSqlClientHandler.Builder withToken(String token)
      Sets the token used in the token authentication.
      Parameters:
      token - the token value.
      Returns:
      this builder instance.
    • withBufferAllocator

      public ArrowFlightSqlClientHandler.Builder withBufferAllocator(BufferAllocator allocator)
      Sets the BufferAllocator to use in this handler.
      Parameters:
      allocator - the allocator.
      Returns:
      this instance.
    • withRetainCookies

      public ArrowFlightSqlClientHandler.Builder withRetainCookies(boolean retainCookies)
      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

      public ArrowFlightSqlClientHandler.Builder withRetainAuth(boolean retainAuth)
      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 provided factories to the list of middlewareFactories of this handler.
      Parameters:
      factories - the factories to add.
      Returns:
      this instance.
    • withMiddlewareFactories

      Adds the provided factories to the list of middlewareFactories of this handler.
      Parameters:
      factories - the factories to add.
      Returns:
      this instance.
    • withCallOptions

      public ArrowFlightSqlClientHandler.Builder withCallOptions(CallOption... options)
      Adds the provided CallOptions to this handler.
      Parameters:
      options - the options
      Returns:
      this instance.
    • withCallOptions

      public ArrowFlightSqlClientHandler.Builder withCallOptions(Collection<CallOption> options)
      Adds the provided CallOptions to this handler.
      Parameters:
      options - the options
      Returns:
      this instance.
    • build

      Builds a new ArrowFlightSqlClientHandler from the provided fields.
      Returns:
      a new client handler.
      Throws:
      SQLException - on error.