aboutsummaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager/src/main/java
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2017-09-22 15:08:34 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-22 15:08:34 +0000
commit7d39eea7a0537b4a1dd6f0d1ac9d30b268e1d91d (patch)
treebd84bd4e32f6f3ff3ec48d56bc01a86adbfd2530 /controlloop/common/eventmanager/src/main/java
parentb2b8f46ab3a524eae487fa932d9ceb2b884a68f5 (diff)
parent1aa30b7d83f97103097c7f5d3e4cbd2fad92f659 (diff)
Merge "Add VFC Response in Working Memory & JUNIT"
Diffstat (limited to 'controlloop/common/eventmanager/src/main/java')
-rw-r--r--controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java23
1 files changed, 22 insertions, 1 deletions
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;
}