From 3573c32a54bce287e215cc9b0cc356d200aef2fd Mon Sep 17 00:00:00 2001 From: Vincenzo Ingenito Date: Fri, 22 Sep 2023 12:00:11 +0200 Subject: [PATCH] feat: Remove EDS flow --- .../rulesmanager/enums/EdsStrategyEnum.java | 1 - .../scheduler/executors/base/ExecutorEDS.java | 4 ++-- .../gtw/rulesmanager/service/IConfigSRV.java | 4 ---- .../rulesmanager/service/impl/ConfigSRV.java | 24 ++----------------- 4 files changed, 4 insertions(+), 29 deletions(-) diff --git a/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/enums/EdsStrategyEnum.java b/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/enums/EdsStrategyEnum.java index 352cdac..b2fc94a 100644 --- a/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/enums/EdsStrategyEnum.java +++ b/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/enums/EdsStrategyEnum.java @@ -2,6 +2,5 @@ public enum EdsStrategyEnum { NO_EDS, - NO_FHIR_EDS, NO_EDS_WITH_LOG } diff --git a/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/scheduler/executors/base/ExecutorEDS.java b/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/scheduler/executors/base/ExecutorEDS.java index dd4caef..2d27dc0 100644 --- a/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/scheduler/executors/base/ExecutorEDS.java +++ b/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/scheduler/executors/base/ExecutorEDS.java @@ -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); } }; diff --git a/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/service/IConfigSRV.java b/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/service/IConfigSRV.java index 1d48bcd..f5f2972 100644 --- a/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/service/IConfigSRV.java +++ b/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/service/IConfigSRV.java @@ -4,11 +4,7 @@ public interface IConfigSRV { String getEdsStrategy(); - boolean isNoEds(); - boolean isNoFhirEds(); - boolean isNoEdsWithLogs(); - boolean areLogsEnabled(); } diff --git a/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/service/impl/ConfigSRV.java b/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/service/impl/ConfigSRV.java index 5ea0b01..5261796 100644 --- a/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/service/impl/ConfigSRV.java +++ b/src/main/java/it/finanze/sanita/fse2/ms/gtw/rulesmanager/service/impl/ConfigSRV.java @@ -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); } + }