Use system specific correlated properties JSON

This commit adds changes to select system specific correlated
properties JSON. Certain PST systems have system specific correlated
properties JSON. The specific correlated properties JSON path is read
from the respective system config JSON. If system config JSON does not
specify correlated properties JSON path, correlated properties listener
is not enabled.

Test:
- Installed BMC image on rainiest simics
- Saw log which says correlated properties listener is disabled as
  correlated properties JSON is not defined in the system config JSON
- Edit the system config JSON and add tag
  "correlatedPropertiesConfigPath"
- vpd-manager now enables correlated properties listener

Change-Id: I624bb6a7285a215b4812e5f2bdbaf0412074fb81
Signed-off-by: Souvik Roy <souvikroyofficial10@gmail.com>
diff --git a/vpd-manager/include/constants.hpp b/vpd-manager/include/constants.hpp
index f5068c9..4efe464 100644
--- a/vpd-manager/include/constants.hpp
+++ b/vpd-manager/include/constants.hpp
@@ -238,8 +238,6 @@
     "/usr/share/vpd/50003_power_vs.json";
 static constexpr auto power_vs_50001_json =
     "/usr/share/vpd/50001_power_vs.json";
-static constexpr auto correlatedPropJsonFile =
-    "/usr/share/vpd/correlated_properties.json";
 
 static constexpr auto rbmcPositionInterface =
     "xyz.openbmc_project.Inventory.Decorator.Position";
diff --git a/vpd-manager/include/listener.hpp b/vpd-manager/include/listener.hpp
index 830a287..19c0521 100644
--- a/vpd-manager/include/listener.hpp
+++ b/vpd-manager/include/listener.hpp
@@ -65,8 +65,7 @@
      * JSON.
      */
     void registerCorrPropCallBack(
-        const std::string& i_correlatedPropJsonFile =
-            constants::correlatedPropJsonFile) noexcept;
+        const std::string& i_correlatedPropJsonFile) noexcept;
 
     /**
      * @brief API to register properties changed callback.
diff --git a/vpd-manager/oem-handler/ibm_handler.cpp b/vpd-manager/oem-handler/ibm_handler.cpp
index 62199f8..83042bb 100644
--- a/vpd-manager/oem-handler/ibm_handler.cpp
+++ b/vpd-manager/oem-handler/ibm_handler.cpp
@@ -142,7 +142,20 @@
 
             if (m_eventListener)
             {
-                m_eventListener->registerCorrPropCallBack();
+                // Check if system config JSON specifies
+                // correlatedPropertiesJson
+                if (m_sysCfgJsonObj.contains("correlatedPropertiesConfigPath"))
+                {
+                    // register correlated properties callback with specific
+                    // correlated properties JSON
+                    m_eventListener->registerCorrPropCallBack(
+                        m_sysCfgJsonObj["correlatedPropertiesConfigPath"]);
+                }
+                else
+                {
+                    m_logger->logMessage(
+                        "Correlated properties JSON path is not defined in system config JSON. Correlated properties listener is disabled.");
+                }
             }
 
             // terminate collection logger