Improved java class documentation
[nonrtric.git] / policy-agent / src / main / java / org / oransc / policyagent / BeanFactory.java
index 06b66ca..93e1739 100644 (file)
@@ -20,8 +20,9 @@
 
 package org.oransc.policyagent;
 
-import org.oransc.policyagent.clients.A1Client;
-import org.oransc.policyagent.clients.A1ClientImpl;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import org.oransc.policyagent.clients.A1ClientFactory;
 import org.oransc.policyagent.configuration.ApplicationConfig;
 import org.oransc.policyagent.repository.Policies;
 import org.oransc.policyagent.repository.PolicyTypes;
@@ -32,6 +33,8 @@ import org.springframework.context.annotation.Configuration;
 
 @Configuration
 class BeanFactory {
+    private final ApplicationConfig applicationConfig = new ApplicationConfig();
+
     @Bean
     public Policies getPolicies() {
         return new Policies();
@@ -49,7 +52,7 @@ class BeanFactory {
 
     @Bean
     public ApplicationConfig getApplicationConfig() {
-        return new ApplicationConfig();
+        return this.applicationConfig;
     }
 
     @Bean
@@ -58,8 +61,13 @@ class BeanFactory {
     }
 
     @Bean
-    A1Client getA1Client() {
-        return new A1ClientImpl();
+    A1ClientFactory getA1ClientFactory() {
+        return new A1ClientFactory(this.applicationConfig);
+    }
+
+    @Bean
+    public ObjectMapper mapper() {
+        return new ObjectMapper();
     }
 
 }