55import dev .dbos .transact .Constants ;
66
77import javax .sql .DataSource ;
8+ import java .util .ArrayList ;
9+ import java .util .Arrays ;
10+ import java .util .List ;
811
912public class DBOSConfig {
1013 private final String name ;
@@ -17,6 +20,10 @@ public class DBOSConfig {
1720 private final int connectionTimeout ;
1821 private final String appDbName ;
1922 private final String sysDbName ;
23+ private final boolean http ;
24+ private final int httpPort ;
25+ private final boolean httpAwaitOnStart ;
26+
2027
2128 private DBOSConfig (Builder builder ) {
2229 this .name = builder .name ;
@@ -29,6 +36,9 @@ private DBOSConfig(Builder builder) {
2936 this .dbPassword = builder .dbPassword ;
3037 this .dbHost = builder .dbHost ;
3138 this .dbPort = builder .dbPort ;
39+ this .http = builder .http ;
40+ this .httpPort = builder .httpPort ;
41+ this .httpAwaitOnStart = builder .httpAwaitOnStart ;
3242
3343 }
3444
@@ -43,6 +53,9 @@ public static class Builder {
4353 private int connectionTimeout = 30000 ;
4454 private String appDbName ;
4555 private String sysDbName ;
56+ private boolean http = false ;
57+ private int httpPort ;
58+ private boolean httpAwaitOnStart = true ;
4659
4760 public Builder name (String name ) {
4861 this .name = name ;
@@ -94,6 +107,21 @@ public Builder sysDbName(String sysDbName) {
94107 return this ;
95108 }
96109
110+ public Builder runAdminServer () {
111+ this .http = true ;
112+ return this ;
113+ }
114+
115+ public Builder adminServerPort (int port ) {
116+ this .httpPort = port ;
117+ return this ;
118+ }
119+
120+ public Builder adminAwaitOnStart (boolean wait ) {
121+ this .httpAwaitOnStart = wait ;
122+ return this ;
123+ }
124+
97125 public DBOSConfig build () {
98126 if (name == null ) throw new IllegalArgumentException ("Name is required" );
99127 if (dbPassword == null ) {
@@ -144,6 +172,18 @@ public int getDbPort() {
144172 return dbPort ;
145173 }
146174
175+ public boolean isHttp () {
176+ return http ;
177+ }
178+
179+ public int getHttpPort () {
180+ return httpPort ;
181+ }
182+
183+ public boolean isHttpAwaitOnStart () {
184+ return httpAwaitOnStart ;
185+ }
186+
147187 @ Override
148188 public String toString () {
149189 return "DBOSConfig{" +
0 commit comments