summaryrefslogtreecommitdiffstats
path: root/dcae-analytics/dcae-analytics-tca-web/src/main
diff options
context:
space:
mode:
authorKai <lukai@chinamobile.com>2020-03-18 14:37:00 +0800
committerLUKAI <lukai@chinamobile.com>2020-03-20 04:47:18 +0000
commit6b79a386cd7bc3cac6bc03fec9d5405b5a6c50cf (patch)
tree40d19cb39fa6f90f647e830a5334a1214171a3c1 /dcae-analytics/dcae-analytics-tca-web/src/main
parent8a31068c107ae9c2c66d4b1aedb16a7a33868c49 (diff)
modify aai enrichment can be disabled
Issue-ID: DCAEGEN2-2145 Signed-off-by: Kai Lu <lukai@chinamobile.com> Change-Id: I6e9b733e4e49829778dc285979ee0405ea9da96e
Diffstat (limited to 'dcae-analytics/dcae-analytics-tca-web/src/main')
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/TcaAppProperties.java2
-rw-r--r--dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaAaiConfig.java6
2 files changed, 7 insertions, 1 deletions
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/TcaAppProperties.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/TcaAppProperties.java
index 2698d9b..fe905f4 100644
--- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/TcaAppProperties.java
+++ b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/TcaAppProperties.java
@@ -88,7 +88,7 @@ public class TcaAppProperties extends BaseConfigBindingServiceProperties {
aai.setUrl(environment.getProperty(ConfigBindingServiceConstants.AAIURL));
aai.setUsername(environment.getProperty(ConfigBindingServiceConstants.AAIUSERNAME));
aai.setPassword(environment.getProperty(ConfigBindingServiceConstants.AAIPASSWORD));
- aai.setGenericVnfPath(ConfigBindingServiceConstants.AAIGENERICVNFPATH);
+ aai.setGenericVnfPath(environment.getProperty(ConfigBindingServiceConstants.AAIGENERICVNFPATH));
aai.setNodeQueryPath(environment.getProperty(ConfigBindingServiceConstants.AAINODEQUERYPATH));
tca.setAai(aai);
diff --git a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaAaiConfig.java b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaAaiConfig.java
index 773b9d3..4ec42d5 100644
--- a/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaAaiConfig.java
+++ b/dcae-analytics/dcae-analytics-tca-web/src/main/java/org/onap/dcae/analytics/tca/web/config/TcaAaiConfig.java
@@ -46,6 +46,9 @@ public class TcaAaiConfig {
@Bean
public RestTemplate aaiRestTemplate(final TcaAaiRestClientPreferences aaiRestClientPreferences,
final RestTemplateBuilder restTemplateBuilder) {
+ if(aaiRestClientPreferences == null) {
+ return null;
+ }
return restTemplateBuilder
.additionalCustomizers(new HttpClientPreferencesCustomizer<>(aaiRestClientPreferences))
.build();
@@ -54,6 +57,9 @@ public class TcaAaiConfig {
@Bean
public TcaAaiEnrichmentService aaiEnrichmentService(final TcaAppProperties tcaAppProperties,
final RestTemplate aaiRestTemplate) {
+ if (aaiRestTemplate == null) {
+ return null;
+ }
return new TcaAaiEnrichmentServiceImpl(tcaAppProperties, aaiRestTemplate);
}