From 9641684f3084e3e6a0ce8b8594258c25c1092c2d Mon Sep 17 00:00:00 2001 From: "Hockla, Ali (ah999m)" Date: Tue, 5 Sep 2017 14:01:04 -0500 Subject: Added changes for vDNS Use Case - MSO Interface Rebased and fixed merge conflicts Issue-ID: POLICY-102 Change-Id: Icc36a2cf6391aa9137593bc04f0d4543798b7ccd Signed-off-by: Ali Hockla Signed-off-by: Hockla, Ali (ah999m) Signed-off-by: HOCKLA Signed-off-by: Hockla, Ali (ah999m) --- .../eventmanager/ControlLoopOperationManager.java | 47 +++++++++++++++++----- 1 file changed, 36 insertions(+), 11 deletions(-) (limited to 'controlloop/common/eventmanager/src/main/java/org/onap') 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 3c264ab24..a1ae9f0d5 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 @@ -40,6 +40,8 @@ import org.onap.policy.controlloop.actor.appc.APPCActorServiceProvider; import org.onap.policy.controlloop.actor.vfc.VFCActorServiceProvider; import org.onap.policy.controlloop.policy.Policy; import org.onap.policy.controlloop.policy.PolicyResult; +import org.onap.policy.controlloop.actor.mso.MSOActorServiceProvider; +import org.onap.policy.mso.SOResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.onap.policy.controlloop.actor.appclcm.AppcLcmActorServiceProvider; @@ -129,11 +131,7 @@ public class ControlLoopOperationManager implements Serializable { switch (policy.getActor()) { case "APPC": break; - case "AOTS": - break; - case "MSO": - break; - case "SDNO": + case "SO": break; case "VFC": break; @@ -215,12 +213,14 @@ public class ControlLoopOperationManager implements Serializable { // this.currentOperation = operation; return operationRequest; - case "MSO": - // - // We are not supporting MSO interface at the moment - // - logger.debug("We are not supporting MSO actor in the latest release."); - return null; + case "SO": + MSOActorServiceProvider SOAsp = new MSOActorServiceProvider(); + this.operationRequest = SOAsp.constructRequest((VirtualControlLoopEvent)onset, operation.operation, this.policy); + + // Save the operation + this.currentOperation = operation; + + return operationRequest; case "VFC": this.operationRequest = VFCActorServiceProvider.constructRequest((VirtualControlLoopEvent) onset, operation.operation, this.policy); this.currentOperation = operation; @@ -341,7 +341,32 @@ public class ControlLoopOperationManager implements Serializable { return result.getKey(); } return null; + } else if (response instanceof SOResponse) { + SOResponse msoResponse = (SOResponse) response; + switch (msoResponse.httpResponseCode) { + case 200: + case 202: + // + // Consider it as success + // + this.completeOperation(new Integer(1), msoResponse.httpResponseCode + " Success", PolicyResult.SUCCESS); + if (this.policyResult != null && this.policyResult.equals(PolicyResult.FAILURE_TIMEOUT)) { + return null; + } + return PolicyResult.SUCCESS; + default: + // + // Consider it as failure + // + this.completeOperation(new Integer(1), msoResponse.httpResponseCode + " 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