import org.onap.clamp.clds.model.properties.ModelProperties;\r
import org.onap.clamp.clds.util.JsonUtils;\r
import org.onap.clamp.clds.util.LoggingUtils;\r
+import org.onap.clamp.util.HttpConnectionManager;\r
import org.springframework.beans.factory.annotation.Autowired;\r
import org.springframework.stereotype.Component;\r
\r
public static final String DCAE_INVENTORY_RETRY_LIMIT = "dcae.intentory.retry.limit";\r
private final ClampProperties refProp;\r
private final CldsDao cldsDao;\r
- private final DcaeHttpConnectionManager dcaeHttpConnectionManager;\r
+ private final HttpConnectionManager httpConnectionManager;\r
\r
+ /**\r
+ * Constructor.\r
+ */\r
@Autowired\r
public DcaeInventoryServices(ClampProperties refProp, CldsDao cldsDao,\r
- DcaeHttpConnectionManager dcaeHttpConnectionManager) {\r
+ HttpConnectionManager httpConnectionManager) {\r
this.refProp = refProp;\r
this.cldsDao = cldsDao;\r
- this.dcaeHttpConnectionManager = dcaeHttpConnectionManager;\r
+ this.httpConnectionManager = httpConnectionManager;\r
}\r
\r
/**\r
}\r
try {\r
// Below are the properties required for calling the dcae inventory\r
- ModelProperties prop = new ModelProperties(cldsModel.getName(), cldsModel.getControlName(), null, false,\r
- "{}", cldsModel.getPropText());\r
+ ModelProperties prop = new ModelProperties(cldsModel.getName(), cldsModel.getControlName(), null,\r
+ false, "{}", cldsModel.getPropText());\r
Global global = prop.getGlobal();\r
String invariantServiceUuid = global.getService();\r
List<String> resourceUuidList = global.getResourceVf();\r
*/\r
public DcaeInventoryResponse getDcaeInformation(String artifactName, String serviceUuid, String resourceUuid)\r
throws IOException, ParseException, InterruptedException {\r
- Date startTime = new Date();\r
LoggingUtils.setTargetContext("DCAE", "getDcaeInformation");\r
String queryString = "?asdcResourceId=" + resourceUuid + "&asdcServiceId=" + serviceUuid + "&typeName="\r
+ artifactName;\r
logger.info("Dcae Inventory Service full url - " + fullUrl);\r
DcaeInventoryResponse response = queryDcaeInventory(fullUrl);\r
LoggingUtils.setResponseContext("0", "Get Dcae Information success", this.getClass().getName());\r
+ Date startTime = new Date();\r
LoggingUtils.setTimeContext(startTime, new Date());\r
return response;\r
}\r
}\r
for (int i = 0; i < retryLimit; i++) {\r
metricsLogger.info("Attempt n°" + i + " to contact DCAE inventory");\r
- String response = dcaeHttpConnectionManager.doDcaeHttpQuery(fullUrl, "GET", null, null);\r
+ String response = httpConnectionManager.doHttpRequest(fullUrl, "GET", null, null, "DCAE", null, null);\r
int totalCount = getTotalCountFromDcaeInventoryResponse(response);\r
metricsLogger.info("getDcaeInformation complete: totalCount returned=" + totalCount);\r
if (totalCount > 0) {\r