diff options
author | vamshi.nemalikonda <vn00480215@techmahindra.com> | 2019-04-10 16:37:08 +0530 |
---|---|---|
committer | Vamshi Krishna Namilikonda <vn00480215@techmahindra.com> | 2019-04-10 13:43:26 +0000 |
commit | 92fc7744a4df901d1688b9fa8da899372ea76fd8 (patch) | |
tree | 4824e50b33023963d8c0977147f3236cdc8e8cc1 /controlloop/common/eventmanager/src/main | |
parent | 776b69ebd28440f84a890b1d4170af77ca5974ff (diff) |
Parse new model ids from operation policy
Takes VFModule info from policy yaml,instead AAI.
Change-Id: If745b3ba32562cbc37571cea29ec7797ee697e88
Issue-ID: POLICY-1545
Signed-off-by: vamshi.nemalikonda <vn00480215@techmahindra.com>
Diffstat (limited to 'controlloop/common/eventmanager/src/main')
-rw-r--r-- | controlloop/common/eventmanager/src/main/java/org/onap/policy/controlloop/eventmanager/ControlLoopOperationManager.java | 28 |
1 files changed, 27 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 8b7b15909..7bd0a0e54 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 @@ -4,6 +4,7 @@ * ================================================================================ * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Huawei Technologies Co., Ltd. All rights reserved. + * Modifications Copyright (C) 2019 Tech Mahindra * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -227,6 +228,31 @@ public class ControlLoopOperationManager implements Serializable { return vnfId; } throw new ControlLoopException("Target does not match target type"); + case VFMODULE: + VirtualControlLoopEvent virtualOnsetEvent = (VirtualControlLoopEvent) this.onset; + if (this.onset.getTarget().equalsIgnoreCase(VSERVER_VSERVER_NAME)) { + return virtualOnsetEvent.getAai().get(VSERVER_VSERVER_NAME); + } else if (this.onset.getTarget().equalsIgnoreCase(GENERIC_VNF_VNF_ID)) { + return virtualOnsetEvent.getAai().get(GENERIC_VNF_VNF_ID); + } else if (this.onset.getTarget().equalsIgnoreCase(GENERIC_VNF_VNF_NAME)) { + /* + * If the onset is enriched with the vnf-id, we don't need an A&AI response + */ + if (virtualOnsetEvent.getAai().containsKey(GENERIC_VNF_VNF_ID)) { + return virtualOnsetEvent.getAai().get(GENERIC_VNF_VNF_ID); + } + + /* + * If the vnf-name was retrieved from the onset then the vnf-id must be obtained + * from the event manager's A&AI GET query + */ + String vnfId = this.eventManager.getVnfResponse().getVnfId(); + if (vnfId == null) { + throw new AaiException("No vnf-id found"); + } + return vnfId; + } + throw new ControlLoopException("Target does not match target type"); default: throw new ControlLoopException("The target type is not supported"); } @@ -989,7 +1015,7 @@ public class ControlLoopOperationManager implements Serializable { /** * Construct a ControlLoopResponse object from actor response and input event. - * + * * @param response the response from actor * @param event the input event * |