X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fo1%2Fves%2FVesEventHandler.cpp;h=bf52f1d50076ff5b6d97697416ea94ad18a9e682;hb=f3ebe72b954b0880bd8a5ddeef806ca29e87af32;hp=48e0ff62d8ec39e0d25a9636449337743148eacd;hpb=6fe137e5c6f9470f4f48448f5651573c42bd8aed;p=o-du%2Fl2.git diff --git a/src/o1/ves/VesEventHandler.cpp b/src/o1/ves/VesEventHandler.cpp index 48e0ff62d..bf52f1d50 100644 --- a/src/o1/ves/VesEventHandler.cpp +++ b/src/o1/ves/VesEventHandler.cpp @@ -21,7 +21,12 @@ #include "VesEventHandler.hpp" -#include "PnfRegistration.hpp" +#include "PnfRegistrationEvent.hpp" +#include "SliceMeasurementEvent.hpp" +#include "Message.hpp" +#include "CellStateChange.hpp" +#include "CellStateChangeStdDef.hpp" +#include "SliceMeasurementEventStdDef.hpp" /******************************************************************* * @@ -79,33 +84,48 @@ VesEventHandler::~VesEventHandler() * * ****************************************************************/ -bool VesEventHandler::prepare(VesEventType evtType) +bool VesEventHandler::prepare(VesEventType evtType, const Message* msg) { //check event type and call funtions accordingly bool ret = true; switch(evtType) { case VesEventType::PNF_REGISTRATION: - { - O1_LOG("\nO1 VesEventHandler : Preparing PNF registration"); - mVesEvent = new PnfRegistration; - break; - } - case VesEventType::FAULT_NOTIFICATION: - O1_LOG("\nO1 VesEventHandler : Preparing VES fault notification"); + { + O1_LOG("\nO1 VesEventHandler : Preparing PNF registration"); + mVesEvent = new PnfRegistrationEvent(); break; - case VesEventType::PM_NOTIFICATION: - O1_LOG("\nO1 VesEventHandler : Preparing VES pm notification"); + } + case VesEventType::PM_SLICE: + { + #ifdef StdDef + mVesEvent = new SliceMeasurementEventStdDef; + O1_LOG("\nO1 VesEventHandler : Preparing Standard VES PM Slice"); + #else + mVesEvent = new SliceMeasurementEvent; + O1_LOG("\nO1 VesEventHandler : Preparing VES PM Slice"); + #endif break; - case VesEventType::HEARTBEAT: - O1_LOG("\nO1 VesEventHandler : Preparing VES heartbeat"); + } + case VesEventType::FAULT_NOTIFICATION: + { + #ifdef StdDef + O1_LOG("\nO1 VesEventHandler : Preparing Standard VES fault notification"); + mVesEvent = new CellStateChangeStdDef(); + #else + O1_LOG("\nO1 VesEventHandler : Preparing VES fault notification"); + mVesEvent = new CellStateChange(); + #endif break; + } + default: - O1_LOG("\nO1 VesEventHandler : VES msg Type is not available"); + O1_LOG("\nO1 VesEventHandler : VES message type does not exist "); ret = false; break; } - if(!mVesEvent->prepare()) { + mVesEvent->init(); + if(!mVesEvent->prepare(msg)) { O1_LOG("\nO1 VesEventHandler : Failed to prepare VES message"); ret = false; }