Switched from Dropwizard to Springboot
[holmes/common.git] / holmes-actions / src / main / java / org / onap / holmes / common / aai / AaiQueryMdons.java
index 892638b..f9e2e5d 100644 (file)
@@ -17,13 +17,13 @@ package org.onap.holmes.common.aai;
 import com.google.gson.JsonArray;
 import com.google.gson.JsonObject;
 import com.google.gson.JsonParser;
-import org.jvnet.hk2.annotations.Service;
 import org.onap.holmes.common.aai.config.AaiConfig;
 import org.onap.holmes.common.config.MicroServiceConfig;
 import org.onap.holmes.common.exception.CorrelationException;
 import org.onap.holmes.common.utils.JerseyClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
 
 import javax.ws.rs.client.Entity;
 import javax.ws.rs.core.MultivaluedHashMap;
@@ -66,7 +66,7 @@ public class AaiQueryMdons {
 
     private String getResponse(String url) throws CorrelationException {
         try {
-            return new JerseyClient().headers(getHeaders()).get(url);
+            return JerseyClient.newInstance().headers(getHeaders()).get(url);
         } catch (Exception e) {
             throw new CorrelationException("Failed to get data from aai", e);
         }
@@ -174,7 +174,7 @@ public class AaiQueryMdons {
 
     private void put(String url, String content) throws CorrelationException {
         try {
-            new JerseyClient().headers(getHeaders()).put(url, Entity.json(content));
+            JerseyClient.newInstance().headers(getHeaders()).put(url, Entity.json(content));
         } catch (Exception e) {
             throw new CorrelationException("Failed to put data in AAI", e);
         }