1 /*******************************************************************************
2 ################################################################################
3 # Copyright (c) [2020-2021] [HCL Technologies Ltd.] #
5 # Licensed under the Apache License, Version 2.0 (the "License"); #
6 # you may not use this file except in compliance with the License. #
7 # You may obtain a copy of the License at #
9 # http://www.apache.org/licenses/LICENSE-2.0 #
11 # Unless required by applicable law or agreed to in writing, software #
12 # distributed under the License is distributed on an "AS IS" BASIS, #
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
14 # See the License for the specific language governing permissions and #
15 # limitations under the License. #
16 ################################################################################
17 *******************************************************************************/
19 /* This file contains functions to support the preparation of Common Header part
23 #include "VesEventHandler.hpp"
24 #include "PnfRegistrationEvent.hpp"
25 #include "SliceMeasurementEvent.hpp"
26 #include "Message.hpp"
27 #include "CellStateChange.hpp"
28 #include "CellStateChangeStdDef.hpp"
30 /*******************************************************************
36 * Function : VesEventHandler
39 * - Constructor intialization
43 ******************************************************************/
44 VesEventHandler::VesEventHandler() : mVesEvent(NULL)
49 /*******************************************************************
55 * Function : ~VesEventHandler
62 ******************************************************************/
63 VesEventHandler::~VesEventHandler()
65 if( mVesEvent != NULL )
69 /*******************************************************************
71 * @brief Prepare VES Message
81 * @return true - success
84 * ****************************************************************/
86 bool VesEventHandler::prepare(VesEventType evtType, const Message* msg)
88 //check event type and call funtions accordingly
92 case VesEventType::PNF_REGISTRATION:
94 O1_LOG("\nO1 VesEventHandler : Preparing PNF registration");
95 mVesEvent = new PnfRegistrationEvent();
98 case VesEventType::PM_SLICE:
100 mVesEvent = new SliceMeasurementEvent;
101 O1_LOG("\nO1 VesEventHandler : Preparing VES PM Slice");
104 case VesEventType::FAULT_NOTIFICATION:
107 O1_LOG("\nO1 VesEventHandler : Preparing Standard VES fault notification");
108 mVesEvent = new CellStateChangeStdDef();
110 O1_LOG("\nO1 VesEventHandler : Preparing VES fault notification");
111 mVesEvent = new CellStateChange();
117 O1_LOG("\nO1 VesEventHandler : VES message type does not exist ");
122 if(!mVesEvent->prepare(msg)) {
123 O1_LOG("\nO1 VesEventHandler : Failed to prepare VES message");
129 /*******************************************************************
131 * @brief Send Ves Message
138 * - Send VES event to SMO
141 * @return true - success
144 * ****************************************************************/
146 bool VesEventHandler::send()
148 if (!mVesEvent->send()) {
149 O1_LOG("\nO1 VesEventHandler : Failed to send VES event");
154 /**********************************************************************
156 **********************************************************************/