diff options
author | Tal Gitelman <tg851x@intl.att.com> | 2018-09-05 17:47:16 +0300 |
---|---|---|
committer | Michael Lando <ml636r@att.com> | 2018-09-05 19:16:34 +0300 |
commit | 503be6d4ac7cfd63d5e17a54bd990de39b201d83 (patch) | |
tree | e94882f7e5849f395dc4b1051211b92f43f1fd8c /catalog-be/src/main/java | |
parent | f773610d0952940db42376cbb36ba63cb2cacc35 (diff) |
add ability to disable tenant isolation.
Change-Id: I35b6db5ec0d3aa91295f57b60c04243b3f3d2208
Issue-ID: SDC-1571
Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
Diffstat (limited to 'catalog-be/src/main/java')
4 files changed, 20 insertions, 8 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java index 9d428c812a..334b3f63d9 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java @@ -94,7 +94,6 @@ public class DistributionEngine implements IDistributionEngine { @PostConstruct private void init() { - LOGGER.trace("Enter init method of DistributionEngine"); DistributionEngineConfiguration distributionEngineConfiguration = ConfigurationManager.getConfigurationManager().getDistributionEngineConfiguration(); @@ -131,7 +130,6 @@ public class DistributionEngine implements IDistributionEngine { distributionEngineClusterHealth.startHealthCheckTask(envNamePerStatus); LOGGER.trace("Exit init method of DistributionEngine"); - } @PreDestroy diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DmaapHealth.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DmaapHealth.java index b48ed78190..653c9c6510 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DmaapHealth.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DmaapHealth.java @@ -73,6 +73,10 @@ public class DmaapHealth { @PostConstruct public DmaapHealth init() { + if(!ConfigurationManager.getConfigurationManager().getConfiguration().getDmaapConsumerConfiguration().isActive()){ + log.debug("Dmaap health check task disabled"); + return this; + } log.trace("Enter init method of Dmaap health"); synchronized (DmaapHealth.class){ this.configuration = ConfigurationManager.getConfigurationManager().getConfiguration().getDmaapConsumerConfiguration(); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngine.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngine.java index 7eb00ba988..9a875e5d48 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngine.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngine.java @@ -51,7 +51,7 @@ public class EnvironmentsEngine implements INotificationHandler { private static final Logger log = Logger.getLogger(EnvironmentsEngine.class.getName()); private ConfigurationManager configurationManager = ConfigurationManager.getConfigurationManager(); - private Map<String, OperationalEnvironmentEntry> environments; + private Map<String, OperationalEnvironmentEntry> environments = new HashMap<>(); private Map<String, AtomicBoolean> envNamePerStatus = new HashMap<>(); private Map<String, DistributionEnginePollingTask> envNamePerPollingTask = new HashMap<>(); private Map<String, DistributionEngineInitTask> envNamePerInitTask = new HashMap<>(); @@ -79,13 +79,17 @@ public class EnvironmentsEngine implements INotificationHandler { @VisibleForTesting @PostConstruct void init() { - log.trace("Environments engine has been initialized. "); try { environments = populateEnvironments(); createUebTopicsForEnvironments(); initDmeGlobalConfig(); + if(!configurationManager.getConfiguration().getDmaapConsumerConfiguration().isActive()){ + log.info("Environments engine is disabled"); + return; + } dmaapConsumer.consumeDmaapTopic(this::handleMessage, - (t, e) -> log.error("An error occurred upon consuming topic by Dmaap consumer client: ", e)); + (t, e) -> log.error("An error occurred upon consuming topic by Dmaap consumer client: ", e)); + log.info("Environments engine has been initialized."); } catch (Exception e) { log.error("An error occurred upon consuming topic by Dmaap consumer client.", e); } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/health/HealthCheckBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/health/HealthCheckBusinessLogic.java index be534f326a..c0a89d6954 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/health/HealthCheckBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/health/HealthCheckBusinessLogic.java @@ -126,6 +126,7 @@ public class HealthCheckBusinessLogic { //Dmaap getDmaapHealthCheck(healthCheckInfos); + // BE getBeHealthCheck(healthCheckInfos); @@ -182,9 +183,14 @@ public class HealthCheckBusinessLogic { } private List<HealthCheckInfo> getDmaapHealthCheck(List<HealthCheckInfo> healthCheckInfos) { - String appVersion = getAppVersion(); - dmaapHealth.getHealthCheckInfo().setVersion(appVersion); - healthCheckInfos.add(dmaapHealth.getHealthCheckInfo()); + if(ConfigurationManager.getConfigurationManager().getConfiguration().getDmaapConsumerConfiguration().isActive()){ + String appVersion = getAppVersion(); + dmaapHealth.getHealthCheckInfo().setVersion(appVersion); + healthCheckInfos.add(dmaapHealth.getHealthCheckInfo()); + } else { + log.debug("Dmaap health check disabled"); + } + return healthCheckInfos; } |