2
2
3
3
import org .apache .kafka .common .config .ConfigDef ;
4
4
5
- import com .redis .spring .batch .common .PoolOptions ;
5
+ import com .redis .spring .batch .common .AbstractOperationExecutor ;
6
6
7
7
import io .lettuce .core .RedisURI ;
8
8
9
9
public abstract class RedisConfigDef extends ConfigDef {
10
10
11
- public static final String CLUSTER_CONFIG = "redis.cluster" ;
12
- private static final boolean CLUSTER_DEFAULT = false ;
13
- private static final String CLUSTER_DOC = "Connect to a Redis Cluster database" ;
14
-
15
- public static final String HOST_CONFIG = "redis.host" ;
16
- private static final String HOST_DEFAULT = "localhost" ;
17
- private static final String HOST_DOC = "The Redis host to connect to" ;
18
-
19
- public static final String PORT_CONFIG = "redis.port" ;
20
- private static final int PORT_DEFAULT = RedisURI .DEFAULT_REDIS_PORT ;
21
- private static final String PORT_DOC = "The Redis port to connect to" ;
22
-
23
- public static final String URI_CONFIG = "redis.uri" ;
24
- private static final String URI_DEFAULT = "" ;
25
- private static final String URI_DOC = "URI of the Redis database to connect to, e.g. redis://redis-12000.redis.com:12000. For secure connections use rediss URI scheme, e.g. rediss://..." ;
26
-
27
- public static final String USERNAME_CONFIG = "redis.username" ;
28
- private static final String USERNAME_DEFAULT = "" ;
29
- private static final String USERNAME_DOC = "Username to use to connect to Redis" ;
30
-
31
- public static final String PASSWORD_CONFIG = "redis.password" ;
32
- private static final String PASSWORD_DEFAULT = "" ;
33
- private static final String PASSWORD_DOC = "Password to use to connect to Redis" ;
34
-
35
- public static final String TIMEOUT_CONFIG = "redis.timeout" ;
36
- private static final long TIMEOUT_DEFAULT = RedisURI .DEFAULT_TIMEOUT ;
37
- private static final String TIMEOUT_DOC = "Redis command timeout in seconds" ;
38
-
39
- public static final String POOL_MAX_CONFIG = "redis.pool" ;
40
- private static final int POOL_MAX_DEFAULT = PoolOptions .DEFAULT_MAX_TOTAL ;
41
- private static final String POOL_MAX_DOC = "Max pool connections" ;
42
-
43
- public static final String TLS_CONFIG = "redis.tls" ;
44
- private static final boolean TLS_DEFAULT = false ;
45
- private static final String TLS_DOC = "Establish a secure TLS connection" ;
46
-
47
- public static final String INSECURE_CONFIG = "redis.insecure" ;
48
- private static final boolean INSECURE_DEFAULT = false ;
49
- private static final String INSECURE_DOC = "Allow insecure connections (e.g. invalid certificates) to Redis when using SSL" ;
50
-
51
- public static final String KEY_CONFIG = "redis.key.file" ;
52
- public static final String KEY_DEFAULT = "" ;
53
- private static final String KEY_DOC = "PKCS#8 private key file to authenticate with (PEM format)" ;
54
-
55
- public static final String KEY_CERT_CONFIG = "redis.key.cert" ;
56
- public static final String KEY_CERT_DEFAULT = "" ;
57
- private static final String KEY_CERT_DOC = "X.509 certificate chain file to authenticate with (PEM format)" ;
58
-
59
- public static final String KEY_PASSWORD_CONFIG = "redis.key.password" ;
60
- private static final String KEY_PASSWORD_DEFAULT = "" ;
61
- private static final String KEY_PASSWORD_DOC = "Password of the private key file. Leave empty if key file is not password-protected" ;
62
-
63
- public static final String CACERT_CONFIG = "redis.cacert" ;
64
- public static final String CACERT_DEFAULT = "" ;
65
- private static final String CACERT_DOC = "X.509 CA certificate file to verify with" ;
66
-
67
- protected RedisConfigDef () {
68
- defineConfigs ();
69
- }
70
-
71
- protected RedisConfigDef (ConfigDef base ) {
72
- super (base );
73
- defineConfigs ();
74
- }
75
-
76
- private void defineConfigs () {
77
- define (CLUSTER_CONFIG , Type .BOOLEAN , CLUSTER_DEFAULT , Importance .MEDIUM , CLUSTER_DOC );
78
- define (HOST_CONFIG , Type .STRING , HOST_DEFAULT , Importance .HIGH , HOST_DOC );
79
- define (PORT_CONFIG , Type .INT , PORT_DEFAULT , Importance .HIGH , PORT_DOC );
80
- define (URI_CONFIG , Type .STRING , URI_DEFAULT , Importance .MEDIUM , URI_DOC );
81
- define (TLS_CONFIG , Type .BOOLEAN , TLS_DEFAULT , Importance .MEDIUM , TLS_DOC );
82
- define (INSECURE_CONFIG , Type .BOOLEAN , INSECURE_DEFAULT , Importance .MEDIUM , INSECURE_DOC );
83
- define (PASSWORD_CONFIG , Type .PASSWORD , PASSWORD_DEFAULT , Importance .MEDIUM , PASSWORD_DOC );
84
- define (USERNAME_CONFIG , Type .STRING , USERNAME_DEFAULT , Importance .MEDIUM , USERNAME_DOC );
85
- define (TIMEOUT_CONFIG , Type .LONG , TIMEOUT_DEFAULT , Importance .MEDIUM , TIMEOUT_DOC );
86
- define (POOL_MAX_CONFIG , Type .INT , POOL_MAX_DEFAULT , Importance .MEDIUM , POOL_MAX_DOC );
87
- define (KEY_CONFIG , Type .STRING , KEY_DEFAULT , Importance .MEDIUM , KEY_DOC );
88
- define (KEY_CERT_CONFIG , Type .STRING , KEY_CERT_DEFAULT , Importance .MEDIUM , KEY_CERT_DOC );
89
- define (KEY_PASSWORD_CONFIG , Type .PASSWORD , KEY_PASSWORD_DEFAULT , Importance .MEDIUM , KEY_PASSWORD_DOC );
90
- define (CACERT_CONFIG , Type .STRING , CACERT_DEFAULT , Importance .MEDIUM , CACERT_DOC );
91
- }
92
-
93
- }
11
+ public static final String CLUSTER_CONFIG = "redis.cluster" ;
12
+
13
+ private static final boolean CLUSTER_DEFAULT = false ;
14
+
15
+ private static final String CLUSTER_DOC = "Connect to a Redis Cluster database" ;
16
+
17
+ public static final String HOST_CONFIG = "redis.host" ;
18
+
19
+ private static final String HOST_DEFAULT = "localhost" ;
20
+
21
+ private static final String HOST_DOC = "The Redis host to connect to" ;
22
+
23
+ public static final String PORT_CONFIG = "redis.port" ;
24
+
25
+ private static final int PORT_DEFAULT = RedisURI .DEFAULT_REDIS_PORT ;
26
+
27
+ private static final String PORT_DOC = "The Redis port to connect to" ;
28
+
29
+ public static final String URI_CONFIG = "redis.uri" ;
30
+
31
+ private static final String URI_DEFAULT = "" ;
32
+
33
+ private static final String URI_DOC = "URI of the Redis database to connect to, e.g. redis://redis-12000.redis.com:12000. For secure connections use rediss URI scheme, e.g. rediss://..." ;
34
+
35
+ public static final String USERNAME_CONFIG = "redis.username" ;
36
+
37
+ private static final String USERNAME_DEFAULT = "" ;
38
+
39
+ private static final String USERNAME_DOC = "Username to use to connect to Redis" ;
40
+
41
+ public static final String PASSWORD_CONFIG = "redis.password" ;
42
+
43
+ private static final String PASSWORD_DEFAULT = "" ;
44
+
45
+ private static final String PASSWORD_DOC = "Password to use to connect to Redis" ;
46
+
47
+ public static final String TIMEOUT_CONFIG = "redis.timeout" ;
48
+
49
+ private static final long TIMEOUT_DEFAULT = RedisURI .DEFAULT_TIMEOUT ;
50
+
51
+ private static final String TIMEOUT_DOC = "Redis command timeout in seconds" ;
52
+
53
+ public static final String POOL_MAX_CONFIG = "redis.pool" ;
54
+
55
+ private static final int POOL_MAX_DEFAULT = AbstractOperationExecutor .DEFAULT_POOL_SIZE ;
56
+
57
+ private static final String POOL_MAX_DOC = "Max pool connections" ;
58
+
59
+ public static final String TLS_CONFIG = "redis.tls" ;
60
+
61
+ private static final boolean TLS_DEFAULT = false ;
62
+
63
+ private static final String TLS_DOC = "Establish a secure TLS connection" ;
64
+
65
+ public static final String INSECURE_CONFIG = "redis.insecure" ;
66
+
67
+ private static final boolean INSECURE_DEFAULT = false ;
68
+
69
+ private static final String INSECURE_DOC = "Allow insecure connections (e.g. invalid certificates) to Redis when using SSL" ;
70
+
71
+ public static final String KEY_CONFIG = "redis.key.file" ;
72
+
73
+ public static final String KEY_DEFAULT = "" ;
74
+
75
+ private static final String KEY_DOC = "PKCS#8 private key file to authenticate with (PEM format)" ;
76
+
77
+ public static final String KEY_CERT_CONFIG = "redis.key.cert" ;
78
+
79
+ public static final String KEY_CERT_DEFAULT = "" ;
80
+
81
+ private static final String KEY_CERT_DOC = "X.509 certificate chain file to authenticate with (PEM format)" ;
82
+
83
+ public static final String KEY_PASSWORD_CONFIG = "redis.key.password" ;
84
+
85
+ private static final String KEY_PASSWORD_DEFAULT = "" ;
86
+
87
+ private static final String KEY_PASSWORD_DOC = "Password of the private key file. Leave empty if key file is not password-protected" ;
88
+
89
+ public static final String CACERT_CONFIG = "redis.cacert" ;
90
+
91
+ public static final String CACERT_DEFAULT = "" ;
92
+
93
+ private static final String CACERT_DOC = "X.509 CA certificate file to verify with" ;
94
+
95
+ protected RedisConfigDef () {
96
+ defineConfigs ();
97
+ }
98
+
99
+ protected RedisConfigDef (ConfigDef base ) {
100
+ super (base );
101
+ defineConfigs ();
102
+ }
103
+
104
+ private void defineConfigs () {
105
+ define (CLUSTER_CONFIG , Type .BOOLEAN , CLUSTER_DEFAULT , Importance .MEDIUM , CLUSTER_DOC );
106
+ define (HOST_CONFIG , Type .STRING , HOST_DEFAULT , Importance .HIGH , HOST_DOC );
107
+ define (PORT_CONFIG , Type .INT , PORT_DEFAULT , Importance .HIGH , PORT_DOC );
108
+ define (URI_CONFIG , Type .STRING , URI_DEFAULT , Importance .MEDIUM , URI_DOC );
109
+ define (TLS_CONFIG , Type .BOOLEAN , TLS_DEFAULT , Importance .MEDIUM , TLS_DOC );
110
+ define (INSECURE_CONFIG , Type .BOOLEAN , INSECURE_DEFAULT , Importance .MEDIUM , INSECURE_DOC );
111
+ define (PASSWORD_CONFIG , Type .PASSWORD , PASSWORD_DEFAULT , Importance .MEDIUM , PASSWORD_DOC );
112
+ define (USERNAME_CONFIG , Type .STRING , USERNAME_DEFAULT , Importance .MEDIUM , USERNAME_DOC );
113
+ define (TIMEOUT_CONFIG , Type .LONG , TIMEOUT_DEFAULT , Importance .MEDIUM , TIMEOUT_DOC );
114
+ define (POOL_MAX_CONFIG , Type .INT , POOL_MAX_DEFAULT , Importance .MEDIUM , POOL_MAX_DOC );
115
+ define (KEY_CONFIG , Type .STRING , KEY_DEFAULT , Importance .MEDIUM , KEY_DOC );
116
+ define (KEY_CERT_CONFIG , Type .STRING , KEY_CERT_DEFAULT , Importance .MEDIUM , KEY_CERT_DOC );
117
+ define (KEY_PASSWORD_CONFIG , Type .PASSWORD , KEY_PASSWORD_DEFAULT , Importance .MEDIUM , KEY_PASSWORD_DOC );
118
+ define (CACERT_CONFIG , Type .STRING , CACERT_DEFAULT , Importance .MEDIUM , CACERT_DOC );
119
+ }
120
+
121
+ }
0 commit comments