/
DatabaseOptions.java
85 lines (69 loc) · 4.35 KB
/
DatabaseOptions.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package org.keycloak.config;
import org.keycloak.config.database.Database;
public class DatabaseOptions {
public static final Option<String> DB_DIALECT = new OptionBuilder<>("db-dialect", String.class)
.category(OptionCategory.DATABASE)
.hidden()
.buildTime(true)
.build();
public static final Option<String> DB_DRIVER = new OptionBuilder<>("db-driver", String.class)
.category(OptionCategory.DATABASE)
.description("The fully qualified class name of the JDBC driver. If not set, a default driver is set accordingly to the chosen database.")
.buildTime(true)
.build();
public static final Option<String> DB = new OptionBuilder<>("db", String.class)
.category(OptionCategory.DATABASE)
.description("The database vendor.")
.defaultValue("dev-file")
.expectedValues(Database.getDatabaseAliases())
.buildTime(true)
.build();
public static final Option<String> DB_URL = new OptionBuilder<>("db-url", String.class)
.category(OptionCategory.DATABASE)
.description("The full database JDBC URL. If not provided, a default URL is set based on the selected database vendor. " +
"For instance, if using 'postgres', the default JDBC URL would be 'jdbc:postgresql://localhost/keycloak'. ")
.build();
public static final Option<String> DB_URL_HOST = new OptionBuilder<>("db-url-host", String.class)
.category(OptionCategory.DATABASE)
.description("Sets the hostname of the default JDBC URL of the chosen vendor. If the `db-url` option is set, this option is ignored.")
.build();
public static final Option<String> DB_URL_DATABASE = new OptionBuilder<>("db-url-database", String.class)
.category(OptionCategory.DATABASE)
.description("Sets the database name of the default JDBC URL of the chosen vendor. If the `db-url` option is set, this option is ignored.")
.build();
public static final Option<Integer> DB_URL_PORT = new OptionBuilder<>("db-url-port", Integer.class)
.category(OptionCategory.DATABASE)
.description("Sets the port of the default JDBC URL of the chosen vendor. If the `db-url` option is set, this option is ignored.")
.build();
public static final Option<String> DB_URL_PROPERTIES = new OptionBuilder<>("db-url-properties", String.class)
.category(OptionCategory.DATABASE)
.description("Sets the properties of the default JDBC URL of the chosen vendor. " +
"Make sure to set the properties accordingly to the format expected by the database vendor, as well as appending the right character at the beginning of this property value. " +
"If the `db-url` option is set, this option is ignored.")
.build();
public static final Option<String> DB_USERNAME = new OptionBuilder<>("db-username", String.class)
.category(OptionCategory.DATABASE)
.description("The username of the database user.")
.build();
public static final Option<String> DB_PASSWORD = new OptionBuilder<>("db-password", String.class)
.category(OptionCategory.DATABASE)
.description("The password of the database user.")
.build();
public static final Option<String> DB_SCHEMA = new OptionBuilder<>("db-schema", String.class)
.category(OptionCategory.DATABASE)
.description("The database schema to be used.")
.build();
public static final Option<Integer> DB_POOL_INITIAL_SIZE = new OptionBuilder<>("db-pool-initial-size", Integer.class)
.category(OptionCategory.DATABASE)
.description("The initial size of the connection pool.")
.build();
public static final Option<Integer> DB_POOL_MIN_SIZE = new OptionBuilder<>("db-pool-min-size", Integer.class)
.category(OptionCategory.DATABASE)
.description("The minimal size of the connection pool.")
.build();
public static final Option<Integer> DB_POOL_MAX_SIZE = new OptionBuilder<>("db-pool-max-size", Integer.class)
.category(OptionCategory.DATABASE)
.defaultValue(100)
.description("The maximum size of the connection pool.")
.build();
}