Package io.confluent.ksql.api.client
Interface ClientOptions
public interface ClientOptions
Options for the ksqlDB
Client
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final String
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Creates a copy of theseClientOptions
.static ClientOptions
create()
Returns the password to be used for HTTP basic authentication, if applicable.Returns the username to be used for HTTP basic authentication, if applicable.int
Returns the maximum number of rows that may be returned in aBatchedQueryResult
.getHost()
Returns the host name of the ksqlDB server to connect to.int
Returns the maximum number of requests per HTTP/2 connection.Returns the key alias.Returns the key password.Returns the key store path.Returns the key store password.int
getPort()
Returns the host port of the ksqlDB server to connect to.Returns a copy of the custom request headers to be sent with ksqlDB requests.Returns the trust store path.Returns the trust store password.boolean
Returns whether ALPN should be used.boolean
Returns whether HTTP basic authentication will be used when connecting to the ksqlDB server.boolean
isUseTls()
Returns whether TLS should be used when connecting to the ksqlDB server.boolean
Returns whether hostname verification (for TLS) is enabled.setBasicAuthCredentials
(String username, String password) Sets the username and password to be used for HTTP basic authentication when connecting to the ksqlDB server.setExecuteQueryMaxResultRows
(int maxRows) Sets the maximum number of rows that may be returned in aBatchedQueryResult
.Sets the host name of the ksqlDB server to connect to.setHttp2MultiplexingLimit
(int http2MultiplexingLimit) Sets the maximum number of requests per HTTP/2 connection.setKeyAlias
(String keyAlias) Sets the key alias.setKeyPassword
(String keyPassword) Sets the key password.setKeyStore
(String keyStorePath) Sets the key store path.setKeyStorePassword
(String keyStorePassword) Sets the key store password.setPort
(int port) Sets the host port of the ksqlDB server to connect to.setRequestHeaders
(Map<String, String> requestHeaders) Sets custom request headers to be sent with requests to the ksqlDB server.setTrustStore
(String trustStorePath) Sets the trust store path.setTrustStorePassword
(String trustStorePassword) Sets the trust store password.setUseAlpn
(boolean useAlpn) Sets whether ALPN should be used.setUseTls
(boolean useTls) Sets whether TLS should be used when connecting to the ksqlDB server.setVerifyHost
(boolean verifyHost) Sets whether hostname verification (for TLS) is enabled.
-
Field Details
-
DEFAULT_HOST
- See Also:
-
DEFAULT_HOST_PORT
static final int DEFAULT_HOST_PORT- See Also:
-
DEFAULT_EXECUTE_QUERY_MAX_RESULT_ROWS
static final int DEFAULT_EXECUTE_QUERY_MAX_RESULT_ROWS- See Also:
-
DEFAULT_HTTP2_MULTIPLEXING_LIMIT
static final int DEFAULT_HTTP2_MULTIPLEXING_LIMIT- See Also:
-
-
Method Details
-
setHost
Sets the host name of the ksqlDB server to connect to. Defaults to "localhost".- Parameters:
host
- host name- Returns:
- a reference to this
-
setPort
Sets the host port of the ksqlDB server to connect to. Defaults to 8088.- Parameters:
port
- host port- Returns:
- a reference to this
-
setUseTls
Sets whether TLS should be used when connecting to the ksqlDB server. Defaults to false.- Parameters:
useTls
- whether TLS should be used- Returns:
- a reference to this
-
setVerifyHost
Sets whether hostname verification (for TLS) is enabled. Defaults to true.- Parameters:
verifyHost
- whether hostname verification should be enabled- Returns:
- a reference to this
-
setUseAlpn
Sets whether ALPN should be used. Defaults to false.- Parameters:
useAlpn
- whether ALPN should be used- Returns:
- a reference to this
-
setTrustStore
Sets the trust store path.- Parameters:
trustStorePath
- trust store path- Returns:
- a reference to this
-
setTrustStorePassword
Sets the trust store password.- Parameters:
trustStorePassword
- trust store password- Returns:
- a reference to this
-
setKeyStore
Sets the key store path.- Parameters:
keyStorePath
- key store path- Returns:
- a reference to this
-
setKeyStorePassword
Sets the key store password.- Parameters:
keyStorePassword
- key store password- Returns:
- a reference to this
-
setKeyPassword
Sets the key password.- Parameters:
keyPassword
- key password- Returns:
- a reference to this
-
setKeyAlias
Sets the key alias.- Parameters:
keyAlias
- key alias- Returns:
- a reference to this
-
setBasicAuthCredentials
Sets the username and password to be used for HTTP basic authentication when connecting to the ksqlDB server. Basic authentication will be used unless both username and password are null (the default).- Parameters:
username
- username for basic authenticationpassword
- password for basic authentication- Returns:
- a reference to this
-
setExecuteQueryMaxResultRows
Sets the maximum number of rows that may be returned in aBatchedQueryResult
. Defaults to 10000.- Parameters:
maxRows
- number of rows- Returns:
- a reference to this
-
setHttp2MultiplexingLimit
Sets the maximum number of requests per HTTP/2 connection. Defaults to -1.- Parameters:
http2MultiplexingLimit
- number of requests- Returns:
- a reference to this
-
setRequestHeaders
Sets custom request headers to be sent with requests to the ksqlDB server. These headers are in addition to any automatic headers such as the authorization header.If this method is called more than once, only the headers passed on the last invocation will be used. To update existing custom headers, use this method in combination with
getRequestHeaders()
.In case of overlap between these custom headers and automatic headers such as the authorization header, these custom headers take precedence.
- Parameters:
requestHeaders
- custom request headers- Returns:
- a reference to this
-
getHost
String getHost()Returns the host name of the ksqlDB server to connect to.- Returns:
- host name
-
getPort
int getPort()Returns the host port of the ksqlDB server to connect to.- Returns:
- host port
-
isUseTls
boolean isUseTls()Returns whether TLS should be used when connecting to the ksqlDB server.- Returns:
- whether TLS should be used
-
isVerifyHost
boolean isVerifyHost()Returns whether hostname verification (for TLS) is enabled.- Returns:
- whether hostname verification is enabled
-
isUseAlpn
boolean isUseAlpn()Returns whether ALPN should be used.- Returns:
- whether ALPN should be used
-
isUseBasicAuth
boolean isUseBasicAuth()Returns whether HTTP basic authentication will be used when connecting to the ksqlDB server.- Returns:
- whether basic authentication will be used
-
getTrustStore
String getTrustStore()Returns the trust store path.- Returns:
- trust store path
-
getTrustStorePassword
String getTrustStorePassword()Returns the trust store password.- Returns:
- trust store password
-
getKeyStore
String getKeyStore()Returns the key store path.- Returns:
- key store path
-
getKeyStorePassword
String getKeyStorePassword()Returns the key store password.- Returns:
- key store password
-
getKeyPassword
String getKeyPassword()Returns the key password.- Returns:
- key password
-
getKeyAlias
String getKeyAlias()Returns the key alias.- Returns:
- key alias
-
getBasicAuthUsername
String getBasicAuthUsername()Returns the username to be used for HTTP basic authentication, if applicable.- Returns:
- username
-
getBasicAuthPassword
String getBasicAuthPassword()Returns the password to be used for HTTP basic authentication, if applicable.- Returns:
- password
-
getExecuteQueryMaxResultRows
int getExecuteQueryMaxResultRows()Returns the maximum number of rows that may be returned in aBatchedQueryResult
.- Returns:
- number of rows
-
getHttp2MultiplexingLimit
int getHttp2MultiplexingLimit()Returns the maximum number of requests per HTTP/2 connection.- Returns:
- number of requests
-
getRequestHeaders
Returns a copy of the custom request headers to be sent with ksqlDB requests. If not set, then this method returns an empty map.- Returns:
- custom request headers
-
copy
ClientOptions copy()Creates a copy of theseClientOptions
.- Returns:
- the copy
-
create
-