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"
28 /*******************************************************************
34 * Function : VesEventHandler
37 * - Constructor intialization
41 ******************************************************************/
42 VesEventHandler::VesEventHandler() : mVesEvent(NULL)
47 /*******************************************************************
53 * Function : ~VesEventHandler
60 ******************************************************************/
61 VesEventHandler::~VesEventHandler()
63 if( mVesEvent != NULL )
67 /*******************************************************************
69 * @brief Prepare VES Message
79 * @return true - success
82 * ****************************************************************/
84 bool VesEventHandler::prepare(VesEventType evtType, const Message* msg)
86 //check event type and call funtions accordingly
90 case VesEventType::PNF_REGISTRATION:
92 O1_LOG("\nO1 VesEventHandler : Preparing PNF registration");
93 mVesEvent = new PnfRegistrationEvent();
96 case VesEventType::PM_SLICE:
98 mVesEvent = new SliceMeasurementEvent;
99 O1_LOG("\nO1 VesEventHandler : Preparing VES PM Slice");
104 O1_LOG("\nO1 VesEventHandler : VES message type does not exist ");
108 if(!mVesEvent->prepare(msg)) {
109 O1_LOG("\nO1 VesEventHandler : Failed to prepare VES message");
115 /*******************************************************************
117 * @brief Send Ves Message
124 * - Send VES event to SMO
127 * @return true - success
130 * ****************************************************************/
132 bool VesEventHandler::send()
134 if (!mVesEvent->send()) {
135 O1_LOG("\nO1 VesEventHandler : Failed to send VES event");
140 /**********************************************************************
142 **********************************************************************/