Skip to content

Commit 93b2152

Browse files
authored
Add check_connection flag to SourceRequest (#2380)
* Add check_connection flag to SourceRequest Related to #2359 * Fix putting constant on left side of equality operator --------- Co-authored-by: Gennadiy Anisimov <gennadiy.anisimov@softwarecountry.com>
1 parent 5481088 commit 93b2152

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/main/java/org/ohdsi/webapi/service/converters/SourceRequestToSourceConverter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public Source convert(SourceRequest request) {
2929
source.setKeyfileName(request.getKeyfileName());
3030
source.setKrbAdminServer(request.getKrbAdminServer());
3131
source.setKrbAuthMethod(KerberosAuthMechanism.getByName(request.getKrbAuthMethod()));
32+
if (request.isCheckConnection() != null) {
33+
source.setCheckConnection(request.isCheckConnection());
34+
}
3235
return source;
3336
}
3437
}

src/main/java/org/ohdsi/webapi/source/Source.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public class Source extends CommonEntity<Integer> implements Serializable {
114114
private boolean isCacheEnabled;
115115

116116
@Column(name = "check_connection")
117-
private boolean checkConnection;
117+
private boolean checkConnection = true;
118118

119119

120120
public String getTableQualifier(DaimonType daimonType) {

src/main/java/org/ohdsi/webapi/source/SourceController.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,9 @@ public SourceInfo updateSource(@PathParam("sourceId") Integer sourceId, @FormDat
238238
}
239239
setKeyfileData(updated, source, file);
240240
transformIfRequired(updated);
241+
if (request.isCheckConnection() == null) {
242+
updated.setCheckConnection(source.isCheckConnection());
243+
}
241244
updated.setModifiedBy(getCurrentUser());
242245
updated.setModifiedDate(new Date());
243246

src/main/java/org/ohdsi/webapi/source/SourceRequest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ public class SourceRequest {
1919
private String krbAdminServer;
2020
private Collection<SourceDaimon> daimons;
2121
private String keyfileName;
22+
private Boolean checkConnection;
2223

2324
public String getName() {
2425

@@ -111,4 +112,12 @@ public void setKeyfileName(String keyfileName) {
111112

112113
this.keyfileName = keyfileName;
113114
}
115+
116+
public Boolean isCheckConnection() {
117+
return checkConnection;
118+
}
119+
120+
public void setCheckConnection(Boolean checkConnection) {
121+
this.checkConnection = checkConnection;
122+
}
114123
}

0 commit comments

Comments
 (0)