diff options
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 * |