diff options
author | Jorge Hernandez <jh1730@att.com> | 2017-09-28 02:51:54 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-28 02:51:54 +0000 |
commit | c0ff48a4338a8e5adcdc30b4298f90c25341c2a0 (patch) | |
tree | f4b2637f76cf4860ff4d02e6304ddc0edd7b2a92 /controlloop | |
parent | 74f8161fbdec7c60a1df7103d39a500953cc7f64 (diff) | |
parent | 19a6f09f4fd90ba4ede88165bd302acf907069ca (diff) |
Merge "Add functionality for VFC request retries"
Diffstat (limited to 'controlloop')
-rw-r--r-- | controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java | 7 |
1 files changed, 5 insertions, 2 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 add981c65..e13352ac0 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 @@ -375,11 +375,12 @@ public class ControlLoopOperationManager implements Serializable { } else if (response instanceof VFCResponse) { VFCResponse vfcResponse = (VFCResponse) response; + Integer operationAttempt = this.attempts; if (vfcResponse.responseDescriptor.getStatus().equalsIgnoreCase("finished")) { // // Consider it as success // - this.completeOperation(new Integer(1), " Success", PolicyResult.SUCCESS); + this.completeOperation(operationAttempt, " Success", PolicyResult.SUCCESS); if (this.policyResult != null && this.policyResult.equals(PolicyResult.FAILURE_TIMEOUT)) { return null; } @@ -388,10 +389,12 @@ public class ControlLoopOperationManager implements Serializable { // // Consider it as failure // - this.completeOperation(new Integer(1), " Failed", PolicyResult.FAILURE); + this.completeOperation(operationAttempt, " Failed", PolicyResult.FAILURE); if (this.policyResult != null && this.policyResult.equals(PolicyResult.FAILURE_TIMEOUT)) { return null; } + // increment operation attempts for retries + this.attempts += 1; return PolicyResult.FAILURE; } } |