Package io.confluent.ksql.api.client
Interface ClientOptions
-
public interface ClientOptions
Options for the ksqlDBClient
.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_EXECUTE_QUERY_MAX_RESULT_ROWS
static String
DEFAULT_HOST
static int
DEFAULT_HOST_PORT
static int
DEFAULT_HTTP2_MULTIPLEXING_LIMIT
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description ClientOptions
copy()
Creates a copy of theseClientOptions
.static ClientOptions
create()
String
getBasicAuthPassword()
Returns the password to be used for HTTP basic authentication, if applicable.String
getBasicAuthUsername()
Returns the username to be used for HTTP basic authentication, if applicable.int
getExecuteQueryMaxResultRows()
Returns the maximum number of rows that may be returned in aBatchedQueryResult
.String
getHost()
Returns the host name of the ksqlDB server to connect to.int
getHttp2MultiplexingLimit()
Returns the maximum number of requests per HTTP/2 connection.String
getKeyAlias()
Returns the key alias.String
getKeyPassword()
Returns the key password.String
getKeyStore()
Returns the key store path.String
getKeyStorePassword()
Returns the key store password.int
getPort()
Returns the host port of the ksqlDB server to connect to.Map<String,String>
getRequestHeaders()
Returns a copy of the custom request headers to be sent with ksqlDB requests.String
getTrustStore()
Returns the trust store path.String
getTrustStorePassword()
Returns the trust store password.boolean
isUseAlpn()
Returns whether ALPN should be used.boolean
isUseBasicAuth()
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
isVerifyHost()
Returns whether hostname verification (for TLS) is enabled.ClientOptions
setBasicAuthCredentials(String username, String password)
Sets the username and password to be used for HTTP basic authentication when connecting to the ksqlDB server.ClientOptions
setExecuteQueryMaxResultRows(int maxRows)
Sets the maximum number of rows that may be returned in aBatchedQueryResult
.ClientOptions
setHost(String host)
Sets the host name of the ksqlDB server to connect to.ClientOptions
setHttp2MultiplexingLimit(int http2MultiplexingLimit)
Sets the maximum number of requests per HTTP/2 connection.ClientOptions
setKeyAlias(String keyAlias)
Sets the key alias.ClientOptions
setKeyPassword(String keyPassword)
Sets the key password.ClientOptions
setKeyStore(String keyStorePath)
Sets the key store path.ClientOptions
setKeyStorePassword(String keyStorePassword)
Sets the key store password.ClientOptions
setPort(int port)
Sets the host port of the ksqlDB server to connect to.ClientOptions
setRequestHeaders(Map<String,String> requestHeaders)
Sets custom request headers to be sent with requests to the ksqlDB server.ClientOptions
setTrustStore(String trustStorePath)
Sets the trust store path.ClientOptions
setTrustStorePassword(String trustStorePassword)
Sets the trust store password.ClientOptions
setUseAlpn(boolean useAlpn)
Sets whether ALPN should be used.ClientOptions
setUseTls(boolean useTls)
Sets whether TLS should be used when connecting to the ksqlDB server.ClientOptions
setVerifyHost(boolean verifyHost)
Sets whether hostname verification (for TLS) is enabled.
-
-
-
Field Detail
-
DEFAULT_HOST
static final String DEFAULT_HOST
- See Also:
- Constant Field Values
-
DEFAULT_HOST_PORT
static final int DEFAULT_HOST_PORT
- See Also:
- Constant Field Values
-
DEFAULT_EXECUTE_QUERY_MAX_RESULT_ROWS
static final int DEFAULT_EXECUTE_QUERY_MAX_RESULT_ROWS
- See Also:
- Constant Field Values
-
DEFAULT_HTTP2_MULTIPLEXING_LIMIT
static final int DEFAULT_HTTP2_MULTIPLEXING_LIMIT
- See Also:
- Constant Field Values
-
-
Method Detail
-
setHost
ClientOptions setHost(String host)
Sets the host name of the ksqlDB server to connect to. Defaults to "localhost".- Parameters:
host
- host name- Returns:
- a reference to this
-
setPort
ClientOptions setPort(int port)
Sets the host port of the ksqlDB server to connect to. Defaults to 8088.- Parameters:
port
- host port- Returns:
- a reference to this
-
setUseTls
ClientOptions setUseTls(boolean useTls)
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
ClientOptions setVerifyHost(boolean verifyHost)
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
ClientOptions setUseAlpn(boolean useAlpn)
Sets whether ALPN should be used. Defaults to false.- Parameters:
useAlpn
- whether ALPN should be used- Returns:
- a reference to this
-
setTrustStore
ClientOptions setTrustStore(String trustStorePath)
Sets the trust store path.- Parameters:
trustStorePath
- trust store path- Returns:
- a reference to this
-
setTrustStorePassword
ClientOptions setTrustStorePassword(String trustStorePassword)
Sets the trust store password.- Parameters:
trustStorePassword
- trust store password- Returns:
- a reference to this
-
setKeyStore
ClientOptions setKeyStore(String keyStorePath)
Sets the key store path.- Parameters:
keyStorePath
- key store path- Returns:
- a reference to this
-
setKeyStorePassword
ClientOptions setKeyStorePassword(String keyStorePassword)
Sets the key store password.- Parameters:
keyStorePassword
- key store password- Returns:
- a reference to this
-
setKeyPassword
ClientOptions setKeyPassword(String keyPassword)
Sets the key password.- Parameters:
keyPassword
- key password- Returns:
- a reference to this
-
setKeyAlias
ClientOptions setKeyAlias(String keyAlias)
Sets the key alias.- Parameters:
keyAlias
- key alias- Returns:
- a reference to this
-
setBasicAuthCredentials
ClientOptions setBasicAuthCredentials(String username, String password)
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
ClientOptions setExecuteQueryMaxResultRows(int maxRows)
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
ClientOptions setHttp2MultiplexingLimit(int http2MultiplexingLimit)
Sets the maximum number of requests per HTTP/2 connection. Defaults to -1.- Parameters:
http2MultiplexingLimit
- number of requests- Returns:
- a reference to this
-
setRequestHeaders
ClientOptions setRequestHeaders(Map<String,String> requestHeaders)
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
Map<String,String> 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
static ClientOptions create()
-
-