diff options
author | 2017-09-05 14:01:04 -0500 | |
---|---|---|
committer | 2017-09-08 13:11:17 +0000 | |
commit | 9641684f3084e3e6a0ce8b8594258c25c1092c2d (patch) | |
tree | 4ec335b3dfffc96931d9c5f4767db52b9857e3fd /controlloop/common/eventmanager/src/main/java/org/onap | |
parent | 66e82ed4ee7bfb98758d62647ef2e771f869b280 (diff) |
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 <ah999m@att.com>
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
Signed-off-by: HOCKLA <ah999m@att.com>
Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
Diffstat (limited to 'controlloop/common/eventmanager/src/main/java/org/onap')
-rw-r--r-- | controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java | 47 |
1 files changed, 36 insertions, 11 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 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; } |