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 "PnfRegistration.hpp"
26 /*******************************************************************
32 * Function : VesEventHandler
35 * - Constructor intialization
39 ******************************************************************/
40 VesEventHandler::VesEventHandler() : mVesEvent(NULL)
45 /*******************************************************************
51 * Function : ~VesEventHandler
58 ******************************************************************/
59 VesEventHandler::~VesEventHandler()
61 if( mVesEvent != NULL )
65 /*******************************************************************
67 * @brief Prepare VES Message
77 * @return true - success
80 * ****************************************************************/
82 bool VesEventHandler::prepare(VesEventType evtType)
84 //check event type and call funtions accordingly
88 case VesEventType::PNF_REGISTRATION:
90 O1_LOG("\nO1 VesEventHandler : Preparing PNF registration");
91 mVesEvent = new PnfRegistration;
94 case VesEventType::FAULT_NOTIFICATION:
95 O1_LOG("\nO1 VesEventHandler : Preparing VES fault notification");
97 case VesEventType::PM_NOTIFICATION:
98 O1_LOG("\nO1 VesEventHandler : Preparing VES pm notification");
100 case VesEventType::HEARTBEAT:
101 O1_LOG("\nO1 VesEventHandler : Preparing VES heartbeat");
104 O1_LOG("\nO1 VesEventHandler : VES msg Type is not available");
108 if(!mVesEvent->prepare()) {
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 **********************************************************************/