From 1aa30b7d83f97103097c7f5d3e4cbd2fad92f659 Mon Sep 17 00:00:00 2001 From: Ritu Sood Date: Mon, 11 Sep 2017 14:20:13 -0700 Subject: Add VFC Response in Working Memory & JUNIT Adding code to insert VFC reponse in working memory and handling that response. Also adding JUNIT and yaml file for VoLTE usecase. Issue-Id: POLICY-212 Change-Id: I74a13272ccd931478d27d80715d8c3ac756fb5c7 Signed-off-by: Ritu Sood --- .../eventmanager/ControlLoopOperationManager.java | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'controlloop/common/eventmanager/src/main/java') diff --git a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java index 8849a2351..ec99c1a5c 100644 --- a/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java +++ b/controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java @@ -45,6 +45,7 @@ import org.onap.policy.controlloop.policy.Policy; import org.onap.policy.controlloop.policy.PolicyResult; import org.onap.policy.controlloop.actor.so.SOActorServiceProvider; import org.onap.policy.so.SOResponse; +import org.onap.policy.vfc.VFCResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -367,8 +368,28 @@ public class ControlLoopOperationManager implements Serializable { return PolicyResult.FAILURE; } + } else if (response instanceof VFCResponse) { + VFCResponse vfcResponse = (VFCResponse) response; + if (vfcResponse.responseDescriptor.getStatus().equalsIgnoreCase("finished")) { + // + // Consider it as success + // + this.completeOperation(new Integer(1), " Success", PolicyResult.SUCCESS); + if (this.policyResult != null && this.policyResult.equals(PolicyResult.FAILURE_TIMEOUT)) { + return null; + } + return PolicyResult.SUCCESS; + } else { + // + // Consider it as failure + // + this.completeOperation(new Integer(1), " Failed", PolicyResult.FAILURE); + if (this.policyResult != null && this.policyResult.equals(PolicyResult.FAILURE_TIMEOUT)) { + return null; + } + return PolicyResult.FAILURE; + } } - return null; } -- cgit 1.2.3-korg