-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathDBOSProperties.java
More file actions
254 lines (187 loc) · 5.71 KB
/
DBOSProperties.java
File metadata and controls
254 lines (187 loc) · 5.71 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
package dev.dbos.transact.spring;
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import org.springframework.boot.context.properties.ConfigurationProperties;
/** Configuration properties for DBOS Transact, bound to the {@code dbos.*} namespace. */
@ConfigurationProperties(prefix = "dbos")
public class DBOSProperties {
/** Application identity: name (required) and version. */
private Application application = new Application();
/**
* Dedicated datasource for the DBOS system database. When not set, DBOS will use the
* application's primary {@code DataSource} bean if one is available in the Spring context.
*/
private Datasource datasource = new Datasource();
/** DBOS Cloud conductor connection settings. */
private Conductor conductor = new Conductor();
/** Admin HTTP server settings. */
private AdminServer adminServer = new AdminServer();
/** Executor ID for this instance. */
private String executorId;
/** Whether to enable workflow patching. Defaults to {@code false}. */
private boolean enablePatching = false;
/** Names of queues this executor should listen on. */
private List<String> listenQueues = new ArrayList<>();
/** Polling interval for the workflow scheduler. */
private Duration schedulerPollingInterval;
/** Admin HTTP server properties. */
public static class AdminServer {
/** Whether to enable the admin HTTP server. Defaults to {@code false}. */
private boolean enabled;
/** Port for the admin HTTP server. Defaults to {@code 3001}. */
private int port = 3001;
public boolean isEnabled() {
return enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
public int getPort() {
return port;
}
public void setPort(int port) {
this.port = port;
}
}
/** Application identity properties. */
public static class Application {
/** Application name. Required if {@code spring.application.name} is not set. */
private String name;
/** Application version string. */
private String version;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
}
/** DBOS Cloud conductor connection properties. */
public static class Conductor {
/** Conductor API key. */
private String key;
/** Conductor domain. */
private String domain;
public String getKey() {
return key;
}
public void setKey(String key) {
this.key = key;
}
public String getDomain() {
return domain;
}
public void setDomain(String domain) {
this.domain = domain;
}
}
/** Dedicated datasource configuration for the DBOS system database. */
public static class Datasource {
/** JDBC URL for the DBOS system database. */
private String url;
/** Database username. */
private String username;
/** Database password. */
private String password;
/** Database schema name for DBOS system tables. */
private String schema;
/** Whether to run database migrations on startup. Defaults to {@code true}. */
private boolean migrate = true;
/**
* Whether to use PostgreSQL LISTEN/NOTIFY for event delivery. Defaults to {@code true}. Set to
* {@code false} to use polling instead
*/
private boolean useListenNotify = true;
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getSchema() {
return schema;
}
public void setSchema(String schema) {
this.schema = schema;
}
public boolean isMigrate() {
return migrate;
}
public void setMigrate(boolean migrate) {
this.migrate = migrate;
}
public boolean isUseListenNotify() {
return useListenNotify;
}
public void setUseListenNotify(boolean useListenNotify) {
this.useListenNotify = useListenNotify;
}
}
public Application getApplication() {
return application;
}
public void setApplication(Application application) {
this.application = application;
}
public Datasource getDatasource() {
return datasource;
}
public void setDatasource(Datasource datasource) {
this.datasource = datasource;
}
public AdminServer getAdminServer() {
return adminServer;
}
public void setAdminServer(AdminServer adminServer) {
this.adminServer = adminServer;
}
public Conductor getConductor() {
return conductor;
}
public void setConductor(Conductor conductor) {
this.conductor = conductor;
}
public String getExecutorId() {
return executorId;
}
public void setExecutorId(String executorId) {
this.executorId = executorId;
}
public boolean isEnablePatching() {
return enablePatching;
}
public void setEnablePatching(boolean enablePatching) {
this.enablePatching = enablePatching;
}
public List<String> getListenQueues() {
return listenQueues;
}
public void setListenQueues(List<String> listenQueues) {
this.listenQueues = listenQueues;
}
public Duration getSchedulerPollingInterval() {
return schedulerPollingInterval;
}
public void setSchedulerPollingInterval(Duration schedulerPollingInterval) {
this.schedulerPollingInterval = schedulerPollingInterval;
}
}