Class Configuration
java.lang.Object
org.sourcelab.kafka.connect.apiclient.Configuration
Configure your Kafka Connect API client.
Also allows for configuring an optional proxy with or without authentication.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbooleanintinttoString()useBasicAuth(String username, String password) Allow setting http Basic-Authentication username and password to authenticate requests.useConnectionTimeToLiveInSeconds(int connectionTimeToLiveInSeconds) Sets maximum time to live for persistent connections.Skip all validation of SSL Certificates.useKeyStore(File keyStoreFile, String password) (Optional) Supply a path to a JKS key store to be used for client validation.Allow setting optional proxy configuration.useProxyAuthentication(String proxyUsername, String proxyPassword) Allow setting credentials for a proxy that requires authentication.useRequestTimeoutInSeconds(int requestTimeoutInSeconds) Set the request timeout value, in seconds.useTrustStore(File trustStoreFile, String password) (Optional) Supply a path to a JKS trust store to be used to validate SSL certificates with.
-
Constructor Details
-
Configuration
Default Constructor.- Parameters:
kafkaConnectHost- Hostname of Kafka-Connect
-
-
Method Details
-
useBasicAuth
Allow setting http Basic-Authentication username and password to authenticate requests.- Parameters:
username- username to authenticate requests to Kafka-Connect with.password- password to authenticate requests to Kafka-Connect with.- Returns:
- Configuration instance.
-
useProxy
Allow setting optional proxy configuration.- Parameters:
proxyHost- Host for the proxy to use.proxyPort- Post for the proxy to use.proxyScheme- Scheme to use, HTTP/HTTPS- Returns:
- Configuration instance.
-
useProxyAuthentication
Allow setting credentials for a proxy that requires authentication.- Parameters:
proxyUsername- Username for proxy.proxyPassword- Password for proxy.- Returns:
- Configuration instance.
-
useInsecureSslCertificates
Skip all validation of SSL Certificates. This is insecure and highly discouraged!- Returns:
- Configuration instance.
-
useTrustStore
(Optional) Supply a path to a JKS trust store to be used to validate SSL certificates with. You'll need this if you're using Self Signed certificates. Alternatively you can can explicitly add your certificate to the JVM's truststore using a command like: keytool -importcert -keystore truststore.jks -file servercert.pem- Parameters:
trustStoreFile- file path to truststore.password- (optional) Password for truststore. Pass null if no password.- Returns:
- Configuration instance.
-
useKeyStore
(Optional) Supply a path to a JKS key store to be used for client validation. You'll need this if your Kafka-Connect instance is configured to only accept requests from clients with a valid certificate.- Parameters:
keyStoreFile- file path to keystore.password- (optional) Password for keystore. Pass null if no password.- Returns:
- Configuration instance.
-
useRequestTimeoutInSeconds
Set the request timeout value, in seconds.- Parameters:
requestTimeoutInSeconds- How long before a request times out, in seconds.- Returns:
- Configuration instance.
-
useConnectionTimeToLiveInSeconds
Sets maximum time to live for persistent connections.- Parameters:
connectionTimeToLiveInSeconds- How long before persistent connection will be interrupted, in seconds- Returns:
- Configuration instance.
-
getProxyHost
-
getProxyPort
public int getProxyPort() -
getProxyScheme
-
getProxyUsername
-
getProxyPassword
-
getApiHost
-
getIgnoreInvalidSslCertificates
public boolean getIgnoreInvalidSslCertificates() -
getTrustStoreFile
-
getTrustStorePassword
-
getRequestTimeoutInSeconds
public int getRequestTimeoutInSeconds() -
getConnectionTimeToLiveInSeconds
public int getConnectionTimeToLiveInSeconds() -
getKeyStoreFile
-
getKeyStorePassword
-
getBasicAuthUsername
-
getBasicAuthPassword
-
toString
-