1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.apache.syncope.common.lib;
20
21 import java.io.Serializable;
22 import java.time.Duration;
23 import org.apache.commons.lang3.StringUtils;
24
25 public abstract class AbstractJDBCConf implements Serializable {
26
27 private static final long serialVersionUID = 2675132530878660196L;
28
29
30
31
32 private String sql;
33
34
35
36
37
38 private String dialect = "org.hibernate.dialect.H2Dialect";
39
40
41
42
43 private String driverClass = "org.h2.Driver";
44
45
46
47
48 private String url = "jdbc:h2:tcp://localhost:9092/mem:authdb;DB_CLOSE_DELAY=-1";
49
50
51
52
53
54
55
56 private String user = "sa";
57
58
59
60
61 private String password = "sa";
62
63
64
65
66 private String defaultCatalog;
67
68
69
70
71 private String defaultSchema;
72
73
74
75
76
77 private String healthQuery = StringUtils.EMPTY;
78
79
80
81
82 private Duration idleTimeout = Duration.parse("PT10M");
83
84
85
86
87
88 private String dataSourceName;
89
90
91
92
93
94 private int minPoolSize = 6;
95
96
97
98
99
100 private int maxPoolSize = 18;
101
102
103
104
105
106
107
108 private Duration maxPoolWait = Duration.parse("PT2S");
109
110
111
112
113
114
115 private boolean poolSuspension;
116
117
118
119
120
121 private long poolTimeoutMillis = 1_000;
122
123
124
125
126
127 private int poolLeakThreshold = 3_000;
128
129 public String getSql() {
130 return sql;
131 }
132
133 public void setSql(final String sql) {
134 this.sql = sql;
135 }
136
137 public String getDialect() {
138 return dialect;
139 }
140
141 public void setDialect(final String dialect) {
142 this.dialect = dialect;
143 }
144
145 public String getDriverClass() {
146 return driverClass;
147 }
148
149 public void setDriverClass(final String driverClass) {
150 this.driverClass = driverClass;
151 }
152
153 public String getUrl() {
154 return url;
155 }
156
157 public void setUrl(final String url) {
158 this.url = url;
159 }
160
161 public String getUser() {
162 return user;
163 }
164
165 public void setUser(final String user) {
166 this.user = user;
167 }
168
169 public String getPassword() {
170 return password;
171 }
172
173 public void setPassword(final String password) {
174 this.password = password;
175 }
176
177 public String getDefaultCatalog() {
178 return defaultCatalog;
179 }
180
181 public void setDefaultCatalog(final String defaultCatalog) {
182 this.defaultCatalog = defaultCatalog;
183 }
184
185 public String getDefaultSchema() {
186 return defaultSchema;
187 }
188
189 public void setDefaultSchema(final String defaultSchema) {
190 this.defaultSchema = defaultSchema;
191 }
192
193 public String getHealthQuery() {
194 return healthQuery;
195 }
196
197 public void setHealthQuery(final String healthQuery) {
198 this.healthQuery = healthQuery;
199 }
200
201 public Duration getIdleTimeout() {
202 return idleTimeout;
203 }
204
205 public void setIdleTimeout(final Duration idleTimeout) {
206 this.idleTimeout = idleTimeout;
207 }
208
209 public String getDataSourceName() {
210 return dataSourceName;
211 }
212
213 public void setDataSourceName(final String dataSourceName) {
214 this.dataSourceName = dataSourceName;
215 }
216
217 public int getMinPoolSize() {
218 return minPoolSize;
219 }
220
221 public void setMinPoolSize(final int minPoolSize) {
222 this.minPoolSize = minPoolSize;
223 }
224
225 public int getMaxPoolSize() {
226 return maxPoolSize;
227 }
228
229 public void setMaxPoolSize(final int maxPoolSize) {
230 this.maxPoolSize = maxPoolSize;
231 }
232
233 public Duration getMaxPoolWait() {
234 return maxPoolWait;
235 }
236
237 public void setMaxPoolWait(final Duration maxPoolWait) {
238 this.maxPoolWait = maxPoolWait;
239 }
240
241 public boolean isPoolSuspension() {
242 return poolSuspension;
243 }
244
245 public void setPoolSuspension(final boolean poolSuspension) {
246 this.poolSuspension = poolSuspension;
247 }
248
249 public long getPoolTimeoutMillis() {
250 return poolTimeoutMillis;
251 }
252
253 public void setPoolTimeoutMillis(final long poolTimeoutMillis) {
254 this.poolTimeoutMillis = poolTimeoutMillis;
255 }
256
257 public int getPoolLeakThreshold() {
258 return poolLeakThreshold;
259 }
260
261 public void setPoolLeakThreshold(final int poolLeakThreshold) {
262 this.poolLeakThreshold = poolLeakThreshold;
263 }
264 }