mirror of
https://github.com/Telecominfraproject/wlan-cloud-owprov.git
synced 2025-11-01 19:17:47 +00:00
Adding removal subscriber
This commit is contained in:
@@ -211,35 +211,39 @@ namespace OpenWifi {
|
|||||||
auto SectionName = Names[0];
|
auto SectionName = Names[0];
|
||||||
std::cout << "Names[0]" << SectionName << std::endl;
|
std::cout << "Names[0]" << SectionName << std::endl;
|
||||||
_OWDEBUG_
|
_OWDEBUG_
|
||||||
auto SectionInfo = O->get(SectionName).extract<Poco::JSON::Object::Ptr>();
|
if(O->isArray(SectionName)) {
|
||||||
_OWDEBUG_
|
Configuration->set(SectionName, O->get(SectionName));
|
||||||
auto InsertInfo = Sections.insert(SectionName);
|
|
||||||
_OWDEBUG_
|
|
||||||
if(InsertInfo.second) {
|
|
||||||
if(Explain_) {
|
|
||||||
Poco::JSON::Object ExObj;
|
|
||||||
ExObj.set("from-uuid", i.info.id);
|
|
||||||
ExObj.set("from-name", i.info.name);
|
|
||||||
ExObj.set("action", "added");
|
|
||||||
ExObj.set("element",SectionInfo);
|
|
||||||
Explanation_.add(ExObj);
|
|
||||||
}
|
|
||||||
_OWDEBUG_
|
|
||||||
auto Result = Poco::makeShared<Poco::JSON::Object>();
|
|
||||||
_OWDEBUG_
|
|
||||||
AddVariables(SectionInfo, Result);
|
|
||||||
_OWDEBUG_
|
|
||||||
Configuration->set(SectionName, Result);
|
|
||||||
_OWDEBUG_
|
|
||||||
} else {
|
} else {
|
||||||
if(Explain_) {
|
auto SectionInfo = O->get(SectionName);
|
||||||
Poco::JSON::Object ExObj;
|
_OWDEBUG_
|
||||||
ExObj.set("from-uuid", i.info.id);
|
auto InsertInfo = Sections.insert(SectionName);
|
||||||
ExObj.set("from-name", i.info.name);
|
_OWDEBUG_
|
||||||
ExObj.set("action", "ignored");
|
if (InsertInfo.second) {
|
||||||
ExObj.set("reason","weight insufficient");
|
if (Explain_) {
|
||||||
ExObj.set("element",SectionInfo);
|
Poco::JSON::Object ExObj;
|
||||||
Explanation_.add(ExObj);
|
ExObj.set("from-uuid", i.info.id);
|
||||||
|
ExObj.set("from-name", i.info.name);
|
||||||
|
ExObj.set("action", "added");
|
||||||
|
ExObj.set("element", SectionInfo);
|
||||||
|
Explanation_.add(ExObj);
|
||||||
|
}
|
||||||
|
_OWDEBUG_
|
||||||
|
auto Result = Poco::makeShared<Poco::JSON::Object>();
|
||||||
|
_OWDEBUG_
|
||||||
|
AddVariables(SectionInfo, Result);
|
||||||
|
_OWDEBUG_
|
||||||
|
Configuration->set(SectionName, Result);
|
||||||
|
_OWDEBUG_
|
||||||
|
} else {
|
||||||
|
if (Explain_) {
|
||||||
|
Poco::JSON::Object ExObj;
|
||||||
|
ExObj.set("from-uuid", i.info.id);
|
||||||
|
ExObj.set("from-name", i.info.name);
|
||||||
|
ExObj.set("action", "ignored");
|
||||||
|
ExObj.set("reason", "weight insufficient");
|
||||||
|
ExObj.set("element", SectionInfo);
|
||||||
|
Explanation_.add(ExObj);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user