Skip to content

Commit

Permalink
feat: Remove EDS flow
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenzo-ingenito committed Sep 22, 2023
1 parent 8611e85 commit 3573c32
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@

public enum EdsStrategyEnum {
NO_EDS,
NO_FHIR_EDS,
NO_EDS_WITH_LOG
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ protected ActionRes startup(String[] steps) {
// === LISTENERS ===
protected OnStepListener onStepFailure(Date timestamp) {
return (name, status) -> {
if (bridge.getConfig().areLogsEnabled() && status == ActionRes.KO) {
if (bridge.getConfig().isNoEdsWithLogs() && status == ActionRes.KO) {
bridge.getLogger().error(LOG_TYPE_CONTROL, "Error while updating GTW configuration items", config.getTitle() + " - " + name, ResultLogEnum.KO, timestamp);
}
};
}
protected OnPlanListener onPlanSuccess(Date timestamp) {
return (status) -> {
if (bridge.getConfig().areLogsEnabled() && status == ActionRes.OK) {
if (bridge.getConfig().isNoEdsWithLogs() && status == ActionRes.OK) {
bridge.getLogger().info(LOG_TYPE_CONTROL, "Successfully updated configuration items", "Update" + " - " + config.getTitle(), ResultLogEnum.OK, timestamp);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ public interface IConfigSRV {

String getEdsStrategy();

boolean isNoEds();

boolean isNoFhirEds();

boolean isNoEdsWithLogs();

boolean areLogsEnabled();
}
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,13 @@ public String getEdsStrategy() {
return edsStrategy;
}

@Override
public boolean isNoFhirEds() {
// Trigger refresh if necessary
String out = getEdsStrategy();
// Evaluate
return StringUtils.isNotBlank(out) && EdsStrategyEnum.NO_FHIR_EDS.name().equalsIgnoreCase(out);
}

@Override
public boolean isNoEdsWithLogs() {
// Trigger refresh if necessary
String out = getEdsStrategy();
// Evaluate
return StringUtils.isNotBlank(out) && EdsStrategyEnum.NO_EDS_WITH_LOG.name().equalsIgnoreCase(out);
}

@Override
public boolean areLogsEnabled() {
return isNoEdsWithLogs() || isNoFhirEds();
}

//Se la strategy è null si setta come default no_eds (quindi non verranno emesse loggate)
@Override
public boolean isNoEds() {
// Trigger refresh if necessary
String out = getEdsStrategy();
// Evaluate
return StringUtils.isBlank(out) || EdsStrategyEnum.NO_EDS.name().equalsIgnoreCase(out);
return StringUtils.isNotBlank(out) || EdsStrategyEnum.NO_EDS_WITH_LOG.name().equalsIgnoreCase(out);
}

}

0 comments on commit 3573c32

Please sign in to comment.