summaryrefslogtreecommitdiffstats
path: root/dcae-analytics/dcae-analytics-web
diff options
context:
space:
mode:
Diffstat (limited to 'dcae-analytics/dcae-analytics-web')
-rw-r--r--dcae-analytics/dcae-analytics-web/pom.xml3
-rw-r--r--dcae-analytics/dcae-analytics-web/src/main/java/org/onap/dcae/analytics/web/spring/ConfigBindingServiceEnvironmentPostProcessor.java11
2 files changed, 10 insertions, 4 deletions
diff --git a/dcae-analytics/dcae-analytics-web/pom.xml b/dcae-analytics/dcae-analytics-web/pom.xml
index 9d87508..2f2ef9f 100644
--- a/dcae-analytics/dcae-analytics-web/pom.xml
+++ b/dcae-analytics/dcae-analytics-web/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.onap.dcaegen2.analytics.tca-gen2</groupId>
<artifactId>dcae-analytics</artifactId>
- <version>1.1.0-SNAPSHOT</version>
+ <version>1.2.0-SNAPSHOT</version>
</parent>
<artifactId>dcae-analytics-web</artifactId>
@@ -143,7 +143,6 @@
<dependency>
<groupId>io.undertow</groupId>
<artifactId>undertow-core</artifactId>
- <version>2.0.17.Final</version>
</dependency>
</dependencies>
diff --git a/dcae-analytics/dcae-analytics-web/src/main/java/org/onap/dcae/analytics/web/spring/ConfigBindingServiceEnvironmentPostProcessor.java b/dcae-analytics/dcae-analytics-web/src/main/java/org/onap/dcae/analytics/web/spring/ConfigBindingServiceEnvironmentPostProcessor.java
index d286d10..8798b4e 100644
--- a/dcae-analytics/dcae-analytics-web/src/main/java/org/onap/dcae/analytics/web/spring/ConfigBindingServiceEnvironmentPostProcessor.java
+++ b/dcae-analytics/dcae-analytics-web/src/main/java/org/onap/dcae/analytics/web/spring/ConfigBindingServiceEnvironmentPostProcessor.java
@@ -229,8 +229,13 @@ public class ConfigBindingServiceEnvironmentPostProcessor implements Environment
Optional<String> configServiceJsonOptional;
JsonElement jsonConfig = jsonObject.get(ConfigBindingServiceConstants.CONFIG);
+ String policies = null;
if (jsonConfig.getAsJsonObject().get(ConfigBindingServiceConstants.CONFIG) != null) {
configServiceJsonOptional = Optional.of(jsonConfig.toString());
+ policies = jsonConfig.getAsJsonObject().get(ConfigBindingServiceConstants.POLICIES)
+ .getAsJsonObject().getAsJsonArray(ConfigBindingServiceConstants.ITEMS).get(0)
+ .getAsJsonObject().get(ConfigBindingServiceConstants.CONFIG)
+ .getAsJsonObject().get(ConfigBindingServiceConstants.TCAPOLICY).toString();
} else {
configServiceJsonOptional = Optional.of(jsonObject.toString());
}
@@ -239,7 +244,9 @@ public class ConfigBindingServiceEnvironmentPostProcessor implements Environment
// values
Map<String, Object> configPropertiesMap = configServiceJsonOptional
.map(new JsonStringToMapFunction(configServicePropertiesKey)).orElse(Collections.emptyMap());
-
+ if (policies != null) {
+ configPropertiesMap.put(ConfigBindingServiceConstants.CONFIG_POLICIES, policies);
+ }
if (configPropertiesMap.isEmpty()) {
logger.warn("No properties found in config binding service");
@@ -264,7 +271,7 @@ public class ConfigBindingServiceEnvironmentPostProcessor implements Environment
.info("Adding property from config service in spring context: {} -> {}", key, value));
MutablePropertySources sources = env.getPropertySources();
addJsonPropertySource(sources, new MapPropertySource(configServicePropertiesKey, filterKeyMap));
-
+
}
return configServiceJsonOptional.get();
}