From 425040c807f03eaae14b3c02708533f4f546d9c6 Mon Sep 17 00:00:00 2001 From: ChrisC Date: Tue, 16 Mar 2021 14:12:46 +0100 Subject: Remove unused dcae-be healthcheck Remove DCAE-DS backend Healthchecks that are noisy in the logs DCAE-DS was sunset in G release Issue-ID: SDC-3514 Signed-off-by: ChrisC Change-Id: Iad9d6738ec813be9b87766ed189deda34e711ab1 --- .../sdc/fe/impl/HealthCheckScheduledTask.java | 35 +--------------------- .../sdc/fe/impl/HealthCheckScheduledTaskTest.java | 15 ---------- 2 files changed, 1 insertion(+), 49 deletions(-) (limited to 'catalog-fe/src') diff --git a/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTask.java b/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTask.java index 61d7597e37..5470fc8568 100644 --- a/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTask.java +++ b/catalog-fe/src/main/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTask.java @@ -57,7 +57,6 @@ import java.util.List; import java.util.Map; import static org.openecomp.sdc.common.api.Constants.HC_COMPONENT_CATALOG_FACADE_MS; -import static org.openecomp.sdc.common.api.Constants.HC_COMPONENT_DCAE; import static org.openecomp.sdc.common.api.Constants.HC_COMPONENT_ON_BOARDING; public class HealthCheckScheduledTask implements Runnable { @@ -67,7 +66,6 @@ public class HealthCheckScheduledTask implements Runnable { private static final String LOG_TARGET_ENTITY_BE = "SDC.BE"; private static final String LOG_TARGET_ENTITY_CONFIG = "SDC.FE.Configuration"; private static final String LOG_TARGET_SERVICE_NAME_OB = "getOnboardingConfig"; - private static final String LOG_TARGET_SERVICE_NAME_DCAE = "getDCAEConfig"; private static final String LOG_TARGET_SERVICE_NAME_FACADE = "getCatalogFacadeConfig"; private static final String LOG_SERVICE_NAME = "/rest/healthCheck"; private static LogFieldsMdcHandler mdcFieldsHandler = new LogFieldsMdcHandler(); @@ -75,12 +73,11 @@ public class HealthCheckScheduledTask implements Runnable { private static final String URL = "%s://%s:%s/sdc2/rest/healthCheck"; private final List healthCheckFeComponents = - Arrays.asList(HC_COMPONENT_ON_BOARDING, HC_COMPONENT_DCAE, HC_COMPONENT_CATALOG_FACADE_MS); + Arrays.asList(HC_COMPONENT_ON_BOARDING, HC_COMPONENT_CATALOG_FACADE_MS); private static final HealthCheckUtil healthCheckUtil = new HealthCheckUtil(); private static final String DEBUG_CONTEXT = "HEALTH_FE"; private static final String EXTERNAL_HC_URL = "%s://%s:%s%s"; private static String ONBOARDING_HC_URL; - private static String DCAE_HC_URL; private static String CATALOG_FACADE_MS_HC_URL; private final HealthCheckService service; @@ -93,10 +90,6 @@ public class HealthCheckScheduledTask implements Runnable { return ONBOARDING_HC_URL; } - static String getDcaeHcUrl() { - return DCAE_HC_URL; - } - static String getCatalogFacadeMsHcUrl() { return CATALOG_FACADE_MS_HC_URL; } @@ -163,9 +156,6 @@ public class HealthCheckScheduledTask implements Runnable { case HC_COMPONENT_ON_BOARDING: healthCheckUri = service.getConfig().getOnboarding().getHealthCheckUriFe(); break; - case HC_COMPONENT_DCAE: - healthCheckUri = service.getConfig().getDcae().getHealthCheckUri(); - break; case HC_COMPONENT_CATALOG_FACADE_MS: healthCheckUri = service.getConfig().getCatalogFacadeMs().getHealthCheckUri(); break; @@ -184,9 +174,6 @@ public class HealthCheckScheduledTask implements Runnable { case HC_COMPONENT_ON_BOARDING: healthCheckUrl = getOnboardingHealthCheckUrl(); break; - case HC_COMPONENT_DCAE: - healthCheckUrl = getDcaeHealthCheckUrl(); - break; case HC_COMPONENT_CATALOG_FACADE_MS: healthCheckUrl = getCatalogFacadeHealthCheckUrl(); break; @@ -345,7 +332,6 @@ public class HealthCheckScheduledTask implements Runnable { healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_CASSANDRA, HealthCheckInfo.HealthCheckStatus.UNKNOWN, null, null)); healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_DISTRIBUTION_ENGINE, HealthCheckInfo.HealthCheckStatus.UNKNOWN, null, null)); healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_ON_BOARDING, HealthCheckInfo.HealthCheckStatus.UNKNOWN, null, null)); - healthCheckInfos.add(new HealthCheckInfo(Constants.HC_COMPONENT_DCAE, HealthCheckInfo.HealthCheckStatus.UNKNOWN, null, null)); healthCheckInfos.add(new HealthCheckInfo(HC_COMPONENT_CATALOG_FACADE_MS, HealthCheckInfo.HealthCheckStatus.UNKNOWN, null, null)); return new HealthCheckWrapper(healthCheckInfos, "UNKNOWN", "UNKNOWN"); } @@ -373,25 +359,6 @@ public class HealthCheckScheduledTask implements Runnable { return ONBOARDING_HC_URL; } - private String getDcaeHealthCheckUrl() { - Configuration.DcaeConfig dcaeConfig = service.getConfig().getDcae(); - ErrorLogOptionalData errorLogOptionalData = ErrorLogOptionalData.newBuilder().targetEntity(LOG_TARGET_ENTITY_CONFIG) - .targetServiceName(LOG_TARGET_SERVICE_NAME_DCAE).build(); - - if (StringUtils.isEmpty(DCAE_HC_URL)) { - if (dcaeConfig != null) { - DCAE_HC_URL = buildHealthCheckUrl( - dcaeConfig.getProtocol(), dcaeConfig.getHost(), - dcaeConfig.getPort(), dcaeConfig.getHealthCheckUri()); - } - else { - log.error(EcompLoggerErrorCode.BUSINESS_PROCESS_ERROR, LOG_SERVICE_NAME, errorLogOptionalData, - "DCAE health check configuration is missing."); - } - } - return DCAE_HC_URL; - } - private String getCatalogFacadeHealthCheckUrl() { Configuration.CatalogFacadeMsConfig catalogFacadeMsConfig = service.getConfig().getCatalogFacadeMs(); ErrorLogOptionalData errorLogOptionalData = ErrorLogOptionalData.newBuilder().targetEntity(LOG_TARGET_ENTITY_CONFIG) diff --git a/catalog-fe/src/test/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTaskTest.java b/catalog-fe/src/test/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTaskTest.java index 362d40cb29..38863f5900 100644 --- a/catalog-fe/src/test/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTaskTest.java +++ b/catalog-fe/src/test/java/org/openecomp/sdc/fe/impl/HealthCheckScheduledTaskTest.java @@ -55,8 +55,6 @@ public class HealthCheckScheduledTaskTest { @Mock private Configuration.CatalogFacadeMsConfig catalogFacadeMsConfig; @Mock - private Configuration.DcaeConfig dcaeConfig; - @Mock private Configuration.OnboardingConfig onboardingConfig; @Mock private Configuration configuration; @@ -106,14 +104,6 @@ public class HealthCheckScheduledTaskTest { buildHealthCheckUrl(any(String.class), any(String.class), any(Integer.class), any(String.class)); } - @Test - public void getDcaeUrlWhenConfigurationIsProvided() { - when(configuration.getDcae()).thenReturn(dcaeConfig); - assertNull(HealthCheckScheduledTask.getDcaeHcUrl()); - healthCheckScheduledTask.getExternalComponentHcUrl(Constants.HC_COMPONENT_DCAE); - assertEquals(HC_URL, HealthCheckScheduledTask.getDcaeHcUrl()); - } - @Test public void getExcludedComponentListWhenCatalogFacadeMsConfigExists() { when(configuration.getCatalogFacadeMs()).thenReturn(catalogFacadeMsConfig); @@ -172,11 +162,6 @@ public class HealthCheckScheduledTaskTest { when(onboardingConfig.getPortFe()).thenReturn(PORT); when(onboardingConfig.getHealthCheckUriFe()).thenReturn(URI); - when(dcaeConfig.getProtocol()).thenReturn(PROTOCOL); - when(dcaeConfig.getHost()).thenReturn(HOST); - when(dcaeConfig.getPort()).thenReturn(PORT); - when(dcaeConfig.getHealthCheckUri()).thenReturn(URI); - when(catalogFacadeMsConfig.getProtocol()).thenReturn(PROTOCOL); when(catalogFacadeMsConfig.getHost()).thenReturn(HOST); when(catalogFacadeMsConfig.getPort()).thenReturn(PORT); -- cgit 1.2.3-korg