aboutsummaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main/java/org/onap/vid/controllers/WebConfig.java
diff options
context:
space:
mode:
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/controllers/WebConfig.java')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controllers/WebConfig.java36
1 files changed, 35 insertions, 1 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/controllers/WebConfig.java b/vid-app-common/src/main/java/org/onap/vid/controllers/WebConfig.java
index 0f4b536a1..fb8b5195c 100644
--- a/vid-app-common/src/main/java/org/onap/vid/controllers/WebConfig.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controllers/WebConfig.java
@@ -21,9 +21,14 @@
package org.onap.vid.controllers;
+import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
+import java.io.IOException;
import org.onap.vid.aai.AaiClient;
import org.onap.vid.aai.AaiClientInterface;
+import org.onap.vid.aai.AaiOverTLSClient;
+import org.onap.vid.aai.AaiOverTLSClientInterface;
+import org.onap.vid.aai.AaiOverTLSPropertySupplier;
import org.onap.vid.aai.AaiResponseTranslator;
import org.onap.vid.aai.PombaClientImpl;
import org.onap.vid.aai.PombaClientInterface;
@@ -48,7 +53,6 @@ import org.onap.vid.services.VidService;
import org.onap.vid.services.VidServiceImpl;
import org.onap.vid.scheduler.SchedulerRestInterface;
import org.onap.vid.scheduler.SchedulerRestInterfaceIfc;
-import org.onap.vid.services.*;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -161,4 +165,34 @@ public class WebConfig {
public SchedulerRestInterfaceIfc getSchedulerRestInterface(){
return new SchedulerRestInterface();
}
+
+
+ @Bean
+ public AaiOverTLSClientInterface getAaiOverTLSClientInterface() {
+
+ io.joshworks.restclient.http.mapper.ObjectMapper objectMapper = new io.joshworks.restclient.http.mapper.ObjectMapper() {
+
+ ObjectMapper om = new ObjectMapper();
+
+ @Override
+ public <T> T readValue(String s, Class<T> aClass) {
+ try {
+ return om.readValue(s, aClass);
+ } catch (IOException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ @Override
+ public String writeValue(Object o) {
+ try {
+ return om.writeValueAsString(o);
+ } catch (JsonProcessingException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ };
+
+ return new AaiOverTLSClient(new SyncRestClient(objectMapper), new AaiOverTLSPropertySupplier());
+ }
}