Fix Rest client of policy agent
[nonrtric.git] / policy-agent / src / main / java / org / oransc / policyagent / configuration / ApplicationConfig.java
index 6c2c91b..5e02098 100644 (file)
@@ -24,7 +24,6 @@ import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Properties;
 
 import javax.validation.constraints.NotEmpty;
 
@@ -44,6 +43,18 @@ public class ApplicationConfig {
     @Value("${app.filepath}")
     private String localConfigurationFilePath;
 
+    @Value("${server.ssl.key-store-type}")
+    private String sslKeyStoreType = "";
+
+    @Value("${server.ssl.key-store-password}")
+    private String sslKeyStorePassword = "";
+
+    @Value("${server.ssl.key-store}")
+    private String sslKeyStore = "";
+
+    @Value("${server.ssl.key-password}")
+    private String sslKeyPassword = "";
+
     @Value("${app.webclient.trust-store-used}")
     private boolean sslTrustStoreUsed = false;
 
@@ -54,10 +65,12 @@ public class ApplicationConfig {
     private String sslTrustStore = "";
 
     private Map<String, RicConfig> ricConfigs = new HashMap<>();
+
     @Getter
-    private Properties dmaapPublisherConfig;
+    private String dmaapConsumerTopicUrl;
+
     @Getter
-    private Properties dmaapConsumerConfig;
+    private String dmaapProducerTopicUrl;
 
     private Map<String, ControllerConfig> controllerConfigs = new HashMap<>();
 
@@ -67,6 +80,10 @@ public class ApplicationConfig {
 
     public WebClientConfig getWebClientConfig() {
         return ImmutableWebClientConfig.builder() //
+            .keyStoreType(this.sslKeyStoreType) //
+            .keyStorePassword(this.sslKeyStorePassword) //
+            .keyStore(this.sslKeyStore) //
+            .keyPassword(this.sslKeyPassword) //
             .isTrustStoreUsed(this.sslTrustStoreUsed) //
             .trustStore(this.sslTrustStore) //
             .trustStorePassword(this.sslTrustStorePassword) //
@@ -109,10 +126,11 @@ public class ApplicationConfig {
         ApplicationConfigParser.ConfigParserResult parserResult) {
 
         Collection<RicConfigUpdate> modifications = new ArrayList<>();
-        this.dmaapPublisherConfig = parserResult.dmaapPublisherConfig();
-        this.dmaapConsumerConfig = parserResult.dmaapConsumerConfig();
         this.controllerConfigs = parserResult.controllerConfigs();
 
+        this.dmaapConsumerTopicUrl = parserResult.dmaapConsumerTopicUrl();
+        this.dmaapProducerTopicUrl = parserResult.dmaapProducerTopicUrl();
+
         Map<String, RicConfig> newRicConfigs = new HashMap<>();
         for (RicConfig newConfig : parserResult.ricConfigs()) {
             RicConfig oldConfig = this.ricConfigs.get(newConfig.name());