Fixed the http request call for VES PM message [Issue-ID: ODUHIGH-412]
[o-du/l2.git] / src / o1 / ves / VesEvent.cpp
index a12d1c7..b19391b 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);
@@ -219,6 +260,9 @@ void VesEvent::createUrl()
 {
    mVesUrl = "https://" + mVesServerIp + ":" + mVesServerPort + "/eventListener/v7";
 }
+
+
+
 /**********************************************************************
   End of file
  **********************************************************************/