control: Provide trigger JSON to signal trigger subscribing

An upcoming signal class trigger will have additional JSON configuration
details for subscribing to it. This removes the generally unused event
name passed to each type of signal and replaces it with the trigger's
JSON configuration where used, which will not be used until the upcoming
`member` type of signal.

Change-Id: I7f9be935ba32ea71d0529f27e8e1c9016f7cec1f
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/triggers/signal.cpp b/control/json/triggers/signal.cpp
index 8b66c5f..fa6d32b 100644
--- a/control/json/triggers/signal.cpp
+++ b/control/json/triggers/signal.cpp
@@ -90,8 +90,8 @@
     }
 }
 
-void propertiesChanged(Manager* mgr, const std::string& eventName,
-                       std::unique_ptr<ActionBase>& action)
+void propertiesChanged(Manager* mgr, std::unique_ptr<ActionBase>& action,
+                       const json&)
 {
     // Groups are optional, but a signal triggered event with no groups
     // will do nothing since signals require a group
@@ -118,8 +118,8 @@
     }
 }
 
-void interfacesAdded(Manager* mgr, const std::string& eventName,
-                     std::unique_ptr<ActionBase>& action)
+void interfacesAdded(Manager* mgr, std::unique_ptr<ActionBase>& action,
+                     const json&)
 {
     // Groups are optional, but a signal triggered event with no groups
     // will do nothing since signals require a group
@@ -144,8 +144,8 @@
     }
 }
 
-void interfacesRemoved(Manager* mgr, const std::string& eventName,
-                       std::unique_ptr<ActionBase>& action)
+void interfacesRemoved(Manager* mgr, std::unique_ptr<ActionBase>& action,
+                       const json&)
 {
     // Groups are optional, but a signal triggered event with no groups
     // will do nothing since signals require a group
@@ -170,8 +170,8 @@
     }
 }
 
-void nameOwnerChanged(Manager* mgr, const std::string& eventName,
-                      std::unique_ptr<ActionBase>& action)
+void nameOwnerChanged(Manager* mgr, std::unique_ptr<ActionBase>& action,
+                      const json&)
 {
     // Groups are optional, but a signal triggered event with no groups
     // will do nothing since signals require a group
@@ -205,9 +205,9 @@
                 // service to appear? When to stop checking?
                 log<level::ERR>(
                     fmt::format(
-                        "Event '{}' will not be triggered by name owner "
-                        "changed signals from service of path {}, interface {}",
-                        eventName, member, group.getInterface())
+                        "Events will not be triggered by name owner changed"
+                        "signals from service of path {}, interface {}",
+                        member, group.getInterface())
                         .c_str());
             }
         }
@@ -240,13 +240,13 @@
         throw std::runtime_error(msg.c_str());
     }
 
-    return [subscriber = std::move(subscriber)](
-               const std::string& eventName, Manager* mgr,
-               std::vector<std::unique_ptr<ActionBase>>& actions) {
+    return [subscriber = std::move(subscriber),
+            jsonObj](const std::string& eventName, Manager* mgr,
+                     std::vector<std::unique_ptr<ActionBase>>& actions) {
         for (auto& action : actions)
         {
             // Call signal subscriber for each group in the action
-            subscriber->second(mgr, eventName, action);
+            subscriber->second(mgr, action, jsonObj);
         }
     };
 }
diff --git a/control/json/triggers/signal.hpp b/control/json/triggers/signal.hpp
index 2ab167b..5ec7e2f 100644
--- a/control/json/triggers/signal.hpp
+++ b/control/json/triggers/signal.hpp
@@ -46,45 +46,41 @@
  * @brief Subscribes to a propertiesChanged signal
  *
  * @param[in] mgr - Pointer to manager of the trigger
- * @param[in] eventName - Name of event associated to the signal
  * @param[in] action - Action to be run when signal is received
  */
-void propertiesChanged(Manager* mgr, const std::string& eventName,
-                       std::unique_ptr<ActionBase>& action);
+void propertiesChanged(Manager* mgr, std::unique_ptr<ActionBase>& action,
+                       const json&);
 
 /**
  * @brief Subscribes to an interfacesAdded signal
  *
  * @param[in] mgr - Pointer to manager of the trigger
- * @param[in] eventName - Name of event associated to the signal
  * @param[in] action - Action to be run when signal is received
  */
-void interfacesAdded(Manager* mgr, const std::string& eventName,
-                     std::unique_ptr<ActionBase>& action);
+void interfacesAdded(Manager* mgr, std::unique_ptr<ActionBase>& action,
+                     const json&);
 
 /**
  * @brief Subscribes to an interfacesRemoved signal
  *
  * @param[in] mgr - Pointer to manager of the trigger
- * @param[in] eventName - Name of event associated to the signal
  * @param[in] action - Action to be run when signal is received
  */
-void interfacesRemoved(Manager* mgr, const std::string& eventName,
-                       std::unique_ptr<ActionBase>& action);
+void interfacesRemoved(Manager* mgr, std::unique_ptr<ActionBase>& action,
+                       const json&);
 
 /**
  * @brief Subscribes to a nameOwnerChanged signal
  *
  * @param[in] mgr - Pointer to manager of the trigger
- * @param[in] eventName - Name of event associated to the signal
  * @param[in] action - Action to be run when signal is received
  */
-void nameOwnerChanged(Manager* mgr, const std::string& eventName,
-                      std::unique_ptr<ActionBase>& actions);
+void nameOwnerChanged(Manager* mgr, std::unique_ptr<ActionBase>& action,
+                      const json&);
 
 // Match setup function for signals
-using SignalMatch = std::function<void(Manager*, const std::string&,
-                                       std::unique_ptr<ActionBase>& action)>;
+using SignalMatch = std::function<void(
+    Manager*, std::unique_ptr<ActionBase>& action, const json&)>;
 
 /* Supported signals to their corresponding match setup functions */
 static const std::unordered_map<std::string, SignalMatch> signals = {