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"
29 #include "SliceMeasurementEventStdDef.hpp"
31 /*******************************************************************
37 * Function : VesEventHandler
40 * - Constructor intialization
44 ******************************************************************/
45 VesEventHandler::VesEventHandler() : mVesEvent(NULL)
50 /*******************************************************************
56 * Function : ~VesEventHandler
63 ******************************************************************/
64 VesEventHandler::~VesEventHandler()
66 if( mVesEvent != NULL )
70 /*******************************************************************
72 * @brief Prepare VES Message
82 * @return true - success
85 * ****************************************************************/
87 bool VesEventHandler::prepare(VesEventType evtType, const Message* msg)
89 //check event type and call funtions accordingly
93 case VesEventType::PNF_REGISTRATION:
95 O1_LOG("\nO1 VesEventHandler : Preparing PNF registration");
96 mVesEvent = new PnfRegistrationEvent();
99 case VesEventType::PM_SLICE:
102 mVesEvent = new SliceMeasurementEventStdDef;
103 O1_LOG("\nO1 VesEventHandler : Preparing Standard VES PM Slice");
105 mVesEvent = new SliceMeasurementEvent;
106 O1_LOG("\nO1 VesEventHandler : Preparing VES PM Slice");
110 case VesEventType::FAULT_NOTIFICATION:
113 O1_LOG("\nO1 VesEventHandler : Preparing Standard VES fault notification");
114 mVesEvent = new CellStateChangeStdDef();
116 O1_LOG("\nO1 VesEventHandler : Preparing VES fault notification");
117 mVesEvent = new CellStateChange();
123 O1_LOG("\nO1 VesEventHandler : VES message type does not exist ");
128 if(!mVesEvent->prepare(msg)) {
129 O1_LOG("\nO1 VesEventHandler : Failed to prepare VES message");
135 /*******************************************************************
137 * @brief Send Ves Message
144 * - Send VES event to SMO
147 * @return true - success
150 * ****************************************************************/
152 bool VesEventHandler::send()
154 if (!mVesEvent->send()) {
155 O1_LOG("\nO1 VesEventHandler : Failed to send VES event");
160 /**********************************************************************
162 **********************************************************************/