summaryrefslogtreecommitdiffstats
path: root/controlloop/common/model-impl/vfc/src/main
diff options
context:
space:
mode:
authorPiyush Garg <piyush.garg1@amdocs.com>2018-08-29 15:40:53 +0530
committerPiyush Garg <piyush.garg1@amdocs.com>2018-08-31 20:48:21 +0000
commit0b6288e180c1d33bba88b3df5e03442c57058db9 (patch)
tree072c9c553f9ac7a4874ce97101be5c6e211d547e /controlloop/common/model-impl/vfc/src/main
parent8279af376b435e1d7dd118a1955c5681edf3b847 (diff)
Added support for VF Module Delete recipe
Enhanced SOActorServiceProvider to support VF Module Delete Recipe. Added SOOperationType enum to map the policy recipe with the SO API that we want to call for a recipe. vf module id from non-base vf module is used to construct the delete request url and same will be deleted. Updated SOManager so that it sends request to SO based on the SOOperationType enum value. Enhanced RESTManager to add support for the http delete using new class HttpDeleteWithBody (to allow pass the payload to the SO delete VF module API). Change-Id: I15b678ed9ebc85dfa7cb62bbf23e41c0fe6e4c69 Issue-ID: POLICY-1079 Signed-off-by: Piyush Garg <piyush.garg1@amdocs.com>
Diffstat (limited to 'controlloop/common/model-impl/vfc/src/main')
-rw-r--r--controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCManager.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCManager.java b/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCManager.java
index 1a8d603b5..d84d0403f 100644
--- a/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCManager.java
+++ b/controlloop/common/model-impl/vfc/src/main/java/org/onap/policy/vfc/VFCManager.java
@@ -108,14 +108,14 @@ public final class VFCManager implements Runnable {
return;
}
- if (httpDetails.a != 202) {
+ if (httpDetails.first != 202) {
logger.warn("VFC Heal Restcall failed");
return;
}
try {
- VFCResponse response = Serialization.gsonPretty.fromJson(httpDetails.b, VFCResponse.class);
- netLogger.info("[IN|{}|{}|]{}{}", "VFC", vfcUrl, SYSTEM_LS, httpDetails.b);
+ VFCResponse response = Serialization.gsonPretty.fromJson(httpDetails.second, VFCResponse.class);
+ netLogger.info("[IN|{}|{}|]{}{}", "VFC", vfcUrl, SYSTEM_LS, httpDetails.second);
String body = Serialization.gsonPretty.toJson(response);
logger.debug("Response to VFC Heal post:");
logger.debug(body);
@@ -129,15 +129,15 @@ public final class VFCManager implements Runnable {
while (attemptsLeft-- > 0) {
netLogger.info("[OUT|{}|{}|]", "VFC", urlGet);
Pair<Integer, String> httpDetailsGet = restManager.get(urlGet, username, password, headers);
- responseGet = Serialization.gsonPretty.fromJson(httpDetailsGet.b, VFCResponse.class);
- netLogger.info("[IN|{}|{}|]{}{}", "VFC", urlGet, SYSTEM_LS, httpDetailsGet.b);
+ responseGet = Serialization.gsonPretty.fromJson(httpDetailsGet.second, VFCResponse.class);
+ netLogger.info("[IN|{}|{}|]{}{}", "VFC", urlGet, SYSTEM_LS, httpDetailsGet.second);
responseGet.setRequestId(vfcRequest.getRequestId().toString());
body = Serialization.gsonPretty.toJson(responseGet);
logger.debug("Response to VFC Heal get:");
logger.debug(body);
String responseStatus = responseGet.getResponseDescriptor().getStatus();
- if (httpDetailsGet.a == 200
+ if (httpDetailsGet.first == 200
&& ("finished".equalsIgnoreCase(responseStatus) || "error".equalsIgnoreCase(responseStatus))) {
logger.debug("VFC Heal Status {}", responseGet.getResponseDescriptor().getStatus());
workingMem.insert(responseGet);