Slice PM Counters VES Standard defined
[o-du/l2.git] / src / o1 / ves / VesEvent.cpp
index a12d1c7..9415df6 100644 (file)
@@ -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
  **********************************************************************/