summaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main
diff options
context:
space:
mode:
authorTal Gitelman <tg851x@intl.att.com>2018-09-05 17:47:16 +0300
committerMichael Lando <ml636r@att.com>2018-09-05 19:16:34 +0300
commit503be6d4ac7cfd63d5e17a54bd990de39b201d83 (patch)
treee94882f7e5849f395dc4b1051211b92f43f1fd8c /catalog-be/src/main
parentf773610d0952940db42376cbb36ba63cb2cacc35 (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')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DistributionEngine.java2
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/DmaapHealth.java4
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/distribution/engine/EnvironmentsEngine.java10
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/health/HealthCheckBusinessLogic.java12
-rw-r--r--catalog-be/src/main/resources/config/configuration.yaml13
-rw-r--r--catalog-be/src/main/resources/scripts/import/tosca/typesToUpgrade.json2
6 files changed, 27 insertions, 16 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;
}
diff --git a/catalog-be/src/main/resources/config/configuration.yaml b/catalog-be/src/main/resources/config/configuration.yaml
index 36cb54c788..3c5565ee36 100644
--- a/catalog-be/src/main/resources/config/configuration.yaml
+++ b/catalog-be/src/main/resources/config/configuration.yaml
@@ -7,7 +7,7 @@ identificationHeaderFields:
# catalog backend hostname
beFqdn: localhost
-# sdccatalog.att.com
+# sdccatalog.com
# catalog backend http port
beHttpPort: 8080
@@ -670,17 +670,18 @@ environmentContext:
- General_Non-Revenue
dmaapConsumerConfiguration:
- hosts: olsd004.wnsnet.attws.com:3905
+ active: true
+ hosts: olsd004.wnsnet.ws.com:3905
consumerGroup: asdc
consumerId: mama #mama - in Order To Consume Remove This String And Replace It With -> mama
timeoutMs: 15000
limit: 1
pollingInterval: 2
- topic: com.att.sdc.23911-SDCforTestDev-v001
+ topic: com.sdc.23911-SDCforTestDev-v001
latitude: 32.109333
longitude: 34.855499
version: 1.0
- serviceName: dmaap-v1.dev.dmaap.dt.saat.acsi.att.com/events
+ serviceName: dmaap-v1.dev.dmaap.dt.saat.acsi.com/events
environment: TEST
partner: BOT_R
routeOffer: MR1
@@ -694,8 +695,8 @@ dmaapConsumerConfiguration:
dme2preferredRouterFilePath: DME2preferredRouter.txt
timeLimitForNotificationHandleMs: 120000
credential:
- username: m09875@sdc.att.com
- password: hmXYcznAljMSisdy8zgcag==
+ username: m09875@sdc.com
+ password: mockhmXYcznAljMSisdy8zgcag==
diff --git a/catalog-be/src/main/resources/scripts/import/tosca/typesToUpgrade.json b/catalog-be/src/main/resources/scripts/import/tosca/typesToUpgrade.json
index 8090649613..1ef72856a4 100644
--- a/catalog-be/src/main/resources/scripts/import/tosca/typesToUpgrade.json
+++ b/catalog-be/src/main/resources/scripts/import/tosca/typesToUpgrade.json
@@ -1,7 +1,5 @@
{
"heat": [
- "configuration",
- "fabricConfiguration",
"Generic_PNF"
],
"normative": [