Skip to content

Commit

Permalink
Add check_connection flag to SourceRequest
Browse files Browse the repository at this point in the history
Related to OHDSI#2359
  • Loading branch information
Gennadiy Anisimov committed Jul 26, 2024
1 parent 5481088 commit aeaf260
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ public Source convert(SourceRequest request) {
source.setKeyfileName(request.getKeyfileName());
source.setKrbAdminServer(request.getKrbAdminServer());
source.setKrbAuthMethod(KerberosAuthMechanism.getByName(request.getKrbAuthMethod()));
if (null != request.isCheckConnection()) {
source.setCheckConnection(request.isCheckConnection());
}
return source;
}
}
2 changes: 1 addition & 1 deletion src/main/java/org/ohdsi/webapi/source/Source.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public class Source extends CommonEntity<Integer> implements Serializable {
private boolean isCacheEnabled;

@Column(name = "check_connection")
private boolean checkConnection;
private boolean checkConnection = true;


public String getTableQualifier(DaimonType daimonType) {
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/ohdsi/webapi/source/SourceController.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ public SourceInfo updateSource(@PathParam("sourceId") Integer sourceId, @FormDat
}
setKeyfileData(updated, source, file);
transformIfRequired(updated);
if (null == request.isCheckConnection()) {
updated.setCheckConnection(source.isCheckConnection());
}
updated.setModifiedBy(getCurrentUser());
updated.setModifiedDate(new Date());

Expand Down
9 changes: 9 additions & 0 deletions src/main/java/org/ohdsi/webapi/source/SourceRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class SourceRequest {
private String krbAdminServer;
private Collection<SourceDaimon> daimons;
private String keyfileName;
private Boolean checkConnection;

public String getName() {

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

this.keyfileName = keyfileName;
}

public Boolean isCheckConnection() {
return checkConnection;
}

public void setCheckConnection(Boolean checkConnection) {
this.checkConnection = checkConnection;
}
}

0 comments on commit aeaf260

Please sign in to comment.