summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai <lukai@chinamobile.com>2020-05-09 15:19:14 +0800
committerKai <lukai@chinamobile.com>2020-05-09 15:19:58 +0800
commit13bb744669580623fd779f287ca9ce647d6182b6 (patch)
tree331cfa3e510d1dc94b61ff9756993307d2cb53ff
parentd2ae13a03ef24fc87ae0a38e41da25bc6d1b192b (diff)
Enable TCAgen2 to policy flow
Issue-ID: DCAEGEN2-2198 Signed-off-by: Kai Lu <lukai@chinamobile.com> Change-Id: I35abe1efd996b9ab9b177f9be1733aaf0b6aaa64
-rw-r--r--dcae-analytics/dcae-analytics-model/src/main/java/org/onap/dcae/analytics/model/configbindingservice/ConfigBindingServiceConstants.java2
-rw-r--r--dcae-analytics/dcae-analytics-web/src/main/java/org/onap/dcae/analytics/web/spring/ConfigBindingServiceEnvironmentPostProcessor.java7
2 files changed, 6 insertions, 3 deletions
diff --git a/dcae-analytics/dcae-analytics-model/src/main/java/org/onap/dcae/analytics/model/configbindingservice/ConfigBindingServiceConstants.java b/dcae-analytics/dcae-analytics-model/src/main/java/org/onap/dcae/analytics/model/configbindingservice/ConfigBindingServiceConstants.java
index 173293d..2693a68 100644
--- a/dcae-analytics/dcae-analytics-model/src/main/java/org/onap/dcae/analytics/model/configbindingservice/ConfigBindingServiceConstants.java
+++ b/dcae-analytics/dcae-analytics-model/src/main/java/org/onap/dcae/analytics/model/configbindingservice/ConfigBindingServiceConstants.java
@@ -39,7 +39,7 @@ public abstract class ConfigBindingServiceConstants {
public static final String SERVICE_NAME_ENV_VARIABLE_VALUE = System.getenv(SERVICE_NAME_ENV_VARIABLE_KEY);
public static final String ENV_CBS_PORT = "CONFIG_BINDING_SERVICE_SERVICE_PORT";
public static final String CONFIG_BINDING_SERVICE_PROPERTIES_KEY = "config-binding-service";
-
+ public static final String SPRING_CONFIG_BINDING_SERVICE_PROPERTIES_KEY = "config-binding-service.config";
public static final String CONFIG_SERVICE_MESSAGE_ROUTER_VALUE = "message_router";
// CONVERT JSON TO MAP
public static final String KEY_SEPARATOR = ".";
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 c41e416..d286d10 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
@@ -81,6 +81,9 @@ public class ConfigBindingServiceEnvironmentPostProcessor implements Environment
private String configServicePropertiesKey =
ConfigBindingServiceConstants.CONFIG_BINDING_SERVICE_PROPERTIES_KEY;
+ private String springConfigServicePropertiesKey =
+ ConfigBindingServiceConstants.SPRING_CONFIG_BINDING_SERVICE_PROPERTIES_KEY;
+
@Override
public void postProcessEnvironment(final ConfigurableEnvironment environment,
final SpringApplication application) {
@@ -247,13 +250,13 @@ public class ConfigBindingServiceEnvironmentPostProcessor implements Environment
final Set<String> springKeyPrefixes =
ConfigBindingServiceConstants.getSpringReservedPropertiesKeyPrefixes();
final Set<String> springKeys = springKeyPrefixes.stream()
- .map(springKeyPrefix -> configServicePropertiesKey + "." + springKeyPrefix)
+ .map(springKeyPrefix -> springConfigServicePropertiesKey + "." + springKeyPrefix)
.collect(Collectors.toSet());
filterKeyMap = configPropertiesMap.entrySet().stream()
.collect(Collectors.toMap((Map.Entry<String, Object> e) -> springKeys.stream()
.anyMatch(springKey -> e.getKey().startsWith(springKey))
- ? e.getKey().substring(configServicePropertiesKey.toCharArray().length + 1)
+ ? e.getKey().substring(springConfigServicePropertiesKey.toCharArray().length + 1)
: e.getKey(),
Map.Entry::getValue));