control: Make setting groups public and static

There could be a need for actions to determine a list of groups to use,
so make setting the groups available for actions to use. For example,
the timer_based_actions action could have groups configured on the list
of actions that it runs when its timer expires. These groups need to be
checked against the active profiles and set on the list of actions.

Change-Id: I5b00f16af12bd15e56a65cb3a82a294860ab6d8d
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/event.hpp b/control/json/event.hpp
index 80e2f95..0e71f79 100644
--- a/control/json/event.hpp
+++ b/control/json/event.hpp
@@ -78,6 +78,29 @@
      */
     void enable();
 
+    /**
+     * @brief Parse group parameters and configure a group object
+     *
+     * @param[in] group - Group object to get configured
+     * @param[in] jsonObj - JSON object for the group
+     *
+     * Configures a given group from a set of JSON configuration attributes
+     */
+    static void configGroup(Group& group, const json& jsonObj);
+
+    /**
+     * @brief Parse and set the event's groups(OPTIONAL)
+     *
+     * @param[in] jsonObj - JSON object for the event
+     * @param[in] profiles - List of profiles to validate groups against
+     * @param[out] groups - List of groups to be configured
+     *
+     * Sets the list of groups associated with the event
+     */
+    static void setGroups(const json& jsonObj,
+                          const std::vector<std::string>& profiles,
+                          std::vector<Group>& groups);
+
   private:
     /* The sdbusplus bus object */
     sdbusplus::bus::bus& _bus;
@@ -105,26 +128,6 @@
     static auto& getAvailGroups() __attribute__((pure));
 
     /**
-     * @brief Parse group parameters and configure a group object
-     *
-     * @param[in] group - Group object to get configured
-     * @param[in] jsonObj - JSON object for the group
-     *
-     * Configures a given group from a set of JSON configuration attributes
-     */
-    void configGroup(Group& group, const json& jsonObj);
-
-    /**
-     * @brief Parse and set the event's groups(OPTIONAL)
-     *
-     * @param[in] jsonObj - JSON object for the event
-     * @param[out] groups - List of groups to be configured
-     *
-     * Sets the list of groups associated with the event
-     */
-    void setGroups(const json& jsonObj, std::vector<Group>& groups);
-
-    /**
      * @brief Parse and set the event's actions(OPTIONAL)
      *
      * @param[in] jsonObj - JSON object for the event