6
6
*/
7
7
package io .streamthoughts .jikkou .kafka .connect .api ;
8
8
9
+ import io .streamthoughts .jikkou .common .utils .Enums ;
9
10
import io .streamthoughts .jikkou .core .config .ConfigProperty ;
10
11
import io .streamthoughts .jikkou .core .config .Configuration ;
12
+ import io .streamthoughts .jikkou .http .client .SslConfigSupport ;
13
+ import io .streamthoughts .jikkou .http .client .ssl .SSLConfig ;
11
14
import java .util .Objects ;
12
15
13
16
public class KafkaConnectClientConfig {
14
17
15
18
public static final ConfigProperty <String > KAFKA_CONNECT_NAME = ConfigProperty
16
- .ofString ("name" )
17
- .description ("Name of the kafka connect cluster." );
19
+ .ofString ("name" )
20
+ .description ("Name of the kafka connect cluster." );
18
21
19
22
public static final ConfigProperty <String > KAFKA_CONNECT_URL = ConfigProperty
20
- .ofString ("url" )
21
- .description ("URL to establish connection to kafka connect cluster." );
23
+ .ofString ("url" )
24
+ .description ("URL to establish connection to kafka connect cluster." );
22
25
23
26
public static final ConfigProperty <String > KAFKA_CONNECT_AUTH_METHOD = ConfigProperty
24
- .ofString ("authMethod" )
25
- .orElse (AuthMethod .NONE .name ())
26
- .description ("Method to use for authenticating on Kafka Connect cluster. Available values are: [none, basicauth]" );
27
+ .ofString ("authMethod" )
28
+ .orElse (AuthMethod .NONE .name ())
29
+ .description ("Method to use for authenticating on Kafka Connect cluster. Available values are: [none, basicauth, ssl ]" );
27
30
28
31
public static final ConfigProperty <String > KAFKA_CONNECT_BASIC_AUTH_USERNAME = ConfigProperty
29
- .ofString ("basicAuthUser" )
30
- .description ("Use when 'kafkaConnect.authMethod' is 'basicauth' to specify the username for Authorization Basic header" );
32
+ .ofString ("basicAuthUser" )
33
+ .description ("Use when 'kafkaConnect.authMethod' is 'basicauth' to specify the username for Authorization Basic header" );
31
34
32
35
public static final ConfigProperty <String > KAFKA_CONNECT_BASIC_AUTH_PASSWORD = ConfigProperty
33
- .ofString ("basicAuthPassword" )
34
- .description ("Use when 'kafkaConnect.authMethod' is 'basicauth' to specify the password for Authorization Basic header" );
36
+ .ofString ("basicAuthPassword" )
37
+ .description ("Use when 'kafkaConnect.authMethod' is 'basicauth' to specify the password for Authorization Basic header" );
35
38
36
39
public static final ConfigProperty <Boolean > KAFKA_CONNECT_DEBUG_LOGGING_ENABLED = ConfigProperty
37
- .ofBoolean ("debugLoggingEnabled" )
38
- .description ("Enable debug logging." )
39
- .orElse (false );
40
+ .ofBoolean ("debugLoggingEnabled" )
41
+ .description ("Enable debug logging." )
42
+ .orElse (false );
40
43
41
44
private final Configuration configuration ;
42
45
@@ -58,7 +61,7 @@ public String getConnectUrl() {
58
61
}
59
62
60
63
public AuthMethod getAuthMethod () {
61
- return AuthMethod .getForNameIgnoreCase (KAFKA_CONNECT_AUTH_METHOD .get (configuration ));
64
+ return Enums .getForNameIgnoreCase (KAFKA_CONNECT_AUTH_METHOD .get (configuration ), AuthMethod . class , AuthMethod . INVALID );
62
65
}
63
66
64
67
public String getBasicAuthUsername () {
@@ -77,7 +80,13 @@ public boolean getDebugLoggingEnabled() {
77
80
return KAFKA_CONNECT_DEBUG_LOGGING_ENABLED .get (configuration );
78
81
}
79
82
80
- /** {@inheritDoc} **/
83
+ public SSLConfig getSslConfig () {
84
+ return SslConfigSupport .getSslConfig (null , configuration );
85
+ }
86
+
87
+ /**
88
+ * {@inheritDoc}
89
+ **/
81
90
@ Override
82
91
public boolean equals (Object o ) {
83
92
if (this == o ) return true ;
@@ -86,7 +95,9 @@ public boolean equals(Object o) {
86
95
return Objects .equals (configuration , that .configuration );
87
96
}
88
97
89
- /** {@inheritDoc} **/
98
+ /**
99
+ * {@inheritDoc}
100
+ **/
90
101
@ Override
91
102
public int hashCode () {
92
103
return Objects .hash (configuration );
0 commit comments