Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check_connection flag to SourceRequest #2380

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 (request.isCheckConnection() != null) {
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 (request.isCheckConnection() == null) {
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;
}
}
Loading