control: Use group objects in actions

Switch to use the group objects created from JSON in the actions which
allows the zone and fan YAML objects to be removed from the JSON based
binary. In switching to the JSON based group objects, the
`default_floor` action required additional methods to be added to the
appropriate objects. These additional methods were copied over from the
associated YAML based object classes.

To reduce the amount of changes in this commit, the `requestIncrease`
method was not copied over and will be in a following commit. An
additional commit will also remove the use of YAML based objects from
the JSON based zone object.

Change-Id: I5fea29f099d0176b2ffe486e79f0c585e744d807
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/manager.cpp b/control/json/manager.cpp
index 78aac29..cf8b070 100644
--- a/control/json/manager.cpp
+++ b/control/json/manager.cpp
@@ -34,6 +34,9 @@
 using json = nlohmann::json;
 
 std::vector<std::string> Manager::_activeProfiles;
+std::map<std::string,
+         std::map<std::pair<std::string, bool>, std::vector<std::string>>>
+    Manager::_servTree;
 
 Manager::Manager(sdbusplus::bus::bus& bus, const sdeventplus::Event& event) :
     _bus(bus), _event(event)
@@ -73,6 +76,29 @@
     return _activeProfiles;
 }
 
+bool Manager::hasOwner(const std::string& path, const std::string& intf)
+{
+    auto itServ = _servTree.find(path);
+    if (itServ == _servTree.end())
+    {
+        // Path not found in cache, therefore owner missing
+        return false;
+    }
+    for (const auto& serv : itServ->second)
+    {
+        auto itIntf = std::find_if(
+            serv.second.begin(), serv.second.end(),
+            [&intf](const auto& interface) { return intf == interface; });
+        if (itIntf != std::end(serv.second))
+        {
+            // Service found, return owner state
+            return serv.first.second;
+        }
+    }
+    // Interface not found in cache, therefore owner missing
+    return false;
+}
+
 unsigned int Manager::getPowerOnDelay()
 {
     auto powerOnDelay = 0;