From e5fad68d3ab3b79d4e69820e485e50bece16494f Mon Sep 17 00:00:00 2001 From: Charles Cole Date: Fri, 27 Oct 2017 16:19:13 -0500 Subject: Send final failure on null vfc request Made sure a final failure is sent and the memroy is cleaned up if we cannot contruct a vfc request. Issue-Id: POLICY-350 Change-Id: Ia9bc827572042ae6ff2d2d2851d33034ee86fc49 Signed-off-by: Charles Cole --- .../controlloop/eventmanager/ControlLoopOperationManager.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'controlloop/common/eventmanager/src/main') 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 1c46b9991..a1b63e487 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 @@ -165,7 +165,7 @@ public class ControlLoopOperationManager implements Serializable { else { throw new ControlLoopException("The target is null"); } - return null; + throw new ControlLoopException("Target does not match target type"); } public ControlLoopOperationManager(ControlLoopEvent onset, Policy policy, ControlLoopEventManager em) throws ControlLoopException, AAIException { @@ -289,9 +289,12 @@ public class ControlLoopOperationManager implements Serializable { return operationRequest; case "VFC": - this.operationRequest = VFCActorServiceProvider.constructRequest((VirtualControlLoopEvent) onset, operation.operation, this.policy, this.eventManager.getVnfResponse()); - this.currentOperation = operation; - return operationRequest; + this.operationRequest = VFCActorServiceProvider.constructRequest((VirtualControlLoopEvent) onset, operation.operation, this.policy, this.eventManager.getVnfResponse()); + this.currentOperation = operation; + if (this.operationRequest == null) { + this.policyResult = PolicyResult.FAILURE; + } + return operationRequest; } return null; -- cgit 1.2.3-korg