X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Forg%2Fonap%2Fclamp%2Fclds%2Fclient%2FDcaeInventoryServices.java;h=d8bfeeaece8627e6e457db1a4b97212a9f34bd29;hb=a6d09fbe1046057b72247f97ac72a521949409ce;hp=e5ef3c67b6d9b00b9e69c863d408d7e72def02ef;hpb=18d2678fbc9d21061ebff3ba2a0261c93c212612;p=clamp.git diff --git a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java b/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java index e5ef3c67..d8bfeeae 100644 --- a/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java +++ b/src/main/java/org/onap/clamp/clds/client/DcaeInventoryServices.java @@ -45,6 +45,7 @@ import org.onap.clamp.clds.model.properties.Global; import org.onap.clamp.clds.model.properties.ModelProperties; import org.onap.clamp.clds.util.JsonUtils; import org.onap.clamp.clds.util.LoggingUtils; +import org.onap.clamp.util.HttpConnectionManager; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -62,14 +63,17 @@ public class DcaeInventoryServices { public static final String DCAE_INVENTORY_RETRY_LIMIT = "dcae.intentory.retry.limit"; private final ClampProperties refProp; private final CldsDao cldsDao; - private final DcaeHttpConnectionManager dcaeHttpConnectionManager; + private final HttpConnectionManager httpConnectionManager; + /** + * Constructor. + */ @Autowired public DcaeInventoryServices(ClampProperties refProp, CldsDao cldsDao, - DcaeHttpConnectionManager dcaeHttpConnectionManager) { + HttpConnectionManager httpConnectionManager) { this.refProp = refProp; this.cldsDao = cldsDao; - this.dcaeHttpConnectionManager = dcaeHttpConnectionManager; + this.httpConnectionManager = httpConnectionManager; } /** @@ -179,7 +183,6 @@ public class DcaeInventoryServices { */ public DcaeInventoryResponse getDcaeInformation(String artifactName, String serviceUuid, String resourceUuid) throws IOException, ParseException, InterruptedException { - Date startTime = new Date(); LoggingUtils.setTargetContext("DCAE", "getDcaeInformation"); String queryString = "?asdcResourceId=" + resourceUuid + "&asdcServiceId=" + serviceUuid + "&typeName=" + artifactName; @@ -187,6 +190,7 @@ public class DcaeInventoryServices { logger.info("Dcae Inventory Service full url - " + fullUrl); DcaeInventoryResponse response = queryDcaeInventory(fullUrl); LoggingUtils.setResponseContext("0", "Get Dcae Information success", this.getClass().getName()); + Date startTime = new Date(); LoggingUtils.setTimeContext(startTime, new Date()); return response; } @@ -203,7 +207,7 @@ public class DcaeInventoryServices { } for (int i = 0; i < retryLimit; i++) { metricsLogger.info("Attempt n°" + i + " to contact DCAE inventory"); - String response = dcaeHttpConnectionManager.doDcaeHttpQuery(fullUrl, "GET", null, null); + String response = httpConnectionManager.doGeneralHttpQuery(fullUrl, "GET", null, null, "DCAE", null, null); int totalCount = getTotalCountFromDcaeInventoryResponse(response); metricsLogger.info("getDcaeInformation complete: totalCount returned=" + totalCount); if (totalCount > 0) {