X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=src%2Fo1%2Fves%2FVesEvent.cpp;h=9415df670d83eca8d3af545ef13152eeef459ac0;hb=6dc8a4c17da24847b3a3aee91b37151f77a8a5bc;hp=a12d1c75e8f670b1235a04c2edd00398f157f643;hpb=af8f9c8f6f7cd5e0a89e5dfa7a566fa5811e110c;p=o-du%2Fl2.git diff --git a/src/o1/ves/VesEvent.cpp b/src/o1/ves/VesEvent.cpp index a12d1c75e..9415df670 100644 --- a/src/o1/ves/VesEvent.cpp +++ b/src/o1/ves/VesEvent.cpp @@ -28,9 +28,6 @@ VesEvent::VesEvent(VesEventType eventType) : mVesEventType(eventType) { - getConfig(); - createUrl(); - mHttpClient = new HttpClient(mVesUrl, mVesServerUsername, mVesServerPassword); }; @@ -45,6 +42,33 @@ VesEvent::~VesEvent() free(mSendData); } + +/******************************************************************* + * + * @brief Initialize the Ves Event + * + * @details + * + * Function : init + * + * Functionality: + * - Intialize the Ves event with configuration + * Sets the URL + * Instantiates the http client + * + * @params[in] IN - void + * @return void + * + * ****************************************************************/ + +void VesEvent::init(){ + + getConfig(); + createUrl(); + mHttpClient = new HttpClient(mVesUrl, mVesServerUsername, mVesServerPassword); + +} + /******************************************************************* * * @brief prepare Ves Event Fields @@ -130,6 +154,23 @@ bool VesEvent::prepare(const Message* msg) return true; } +/******************************************************************* + * + * @brief Send the Ves event over Http + * + * @details + * + * Function : send + * + * Functionality: + * - Sends the Ves event over http + * + * @params[in] IN - void + * @return true - success + * false - failure + * + * ****************************************************************/ + bool VesEvent::send() { return mHttpClient->send(mSendData); @@ -151,7 +192,7 @@ bool VesEvent::send() * @return string : Ves Event Name ******************************************************************/ -string VesEvent::getEventFieldName() +string VesEvent::getEventFieldName() { switch(mVesEventType) @@ -162,11 +203,19 @@ string VesEvent::getEventFieldName() } case VesEventType::FAULT_NOTIFICATION: { + #ifdef StdDef + return "stndDefinedFields"; + #else return "faultFields"; + #endif } case VesEventType::PM_SLICE: { + #ifdef StdDef + return "stndDefinedFields"; + #else return "measurementFields"; + #endif } case VesEventType::HEARTBEAT: { @@ -219,6 +268,9 @@ void VesEvent::createUrl() { mVesUrl = "https://" + mVesServerIp + ":" + mVesServerPort + "/eventListener/v7"; } + + + /********************************************************************** End of file **********************************************************************/