#include <BridgeStore.h>
Public Member Functions | |
| BridgeStore (const BridgeStore &)=delete | |
| BridgeStore (BridgeStore &&)=delete | |
| BridgeStore & | operator= (const BridgeStore &)=delete |
| BridgeStore & | operator= (const BridgeStore &&)=delete |
| bool | loadAndValidate (const std::string &fileName) |
| bool | patch (const nlohmann::json &jsonPatch) |
| void | activateStaged () |
| Broker * | getBroker (const std::string &fullInstanceName) |
| const std::map< std::string, Broker > & | getBrokers () const |
| const std::map< const std::string, Bridge > & | getBridgeMap () |
| const nlohmann::json & | getBridgesConfigJson () |
| void | mqttConnected (Broker &broker, mqtt::bridge::lib::Mqtt *mqtt) const |
| void | mqttDisconnected (Broker &broker, mqtt::bridge::lib::Mqtt *mqtt) const |
Static Public Member Functions | |
| static BridgeStore & | instance () |
Private Member Functions | |
| BridgeStore ()=default | |
Private Attributes | |
| std::map< const std::string, Bridge > | bridgeMap |
| nlohmann::json | bridgesConfigJsonActive |
| nlohmann::json | bridgesConfigJsonStaged |
| nlohmann::json_schema::json_validator | validator |
| std::string | fileName |
Definition at line 60 of file BridgeStore.h.
|
privatedefault |
|
delete |
|
delete |
| void mqtt::bridge::lib::BridgeStore::activateStaged | ( | ) |
Definition at line 165 of file BridgeStore.cpp.
References bridgeMap, bridgesConfigJsonActive, bridgesConfigJsonStaged, and fileName.
Referenced by loadAndValidate(), and restartBridges().
| const std::map< const std::string, Bridge > & mqtt::bridge::lib::BridgeStore::getBridgeMap | ( | ) |
Definition at line 225 of file BridgeStore.cpp.
References bridgeMap.
| const nlohmann::json & mqtt::bridge::lib::BridgeStore::getBridgesConfigJson | ( | ) |
Definition at line 229 of file BridgeStore.cpp.
References bridgesConfigJsonActive.
| Broker * mqtt::bridge::lib::BridgeStore::getBroker | ( | const std::string & | fullInstanceName | ) |
Definition at line 258 of file BridgeStore.cpp.
References bridgeMap.
Referenced by mqtt::bridge::SocketContextFactory::create(), and mqtt::mqttbridge::websocket::SubProtocolFactory::create().
| const std::map< std::string, Broker > & mqtt::bridge::lib::BridgeStore::getBrokers | ( | ) | const |
|
static |
Definition at line 65 of file BridgeStore.cpp.
Referenced by mqtt::bridge::SocketContextFactory::create(), mqtt::mqttbridge::websocket::SubProtocolFactory::create(), main(), mqtt::bridge::lib::Mqtt::onConnack(), mqtt::bridge::lib::Mqtt::onDisconnected(), and restartBridges().
| bool mqtt::bridge::lib::BridgeStore::loadAndValidate | ( | const std::string & | fileName | ) |
Definition at line 71 of file BridgeStore.cpp.
References activateStaged(), bridgeMap, bridgesConfigJsonActive, bridgesConfigJsonStaged, fileName, nlohmann::json_schema::json_validator::set_root_schema(), nlohmann::json_schema::json_validator::validate(), and validator.
Referenced by main().
| void mqtt::bridge::lib::BridgeStore::mqttConnected | ( | Broker & | broker, |
| mqtt::bridge::lib::Mqtt * | mqtt ) const |
Definition at line 233 of file BridgeStore.cpp.
References mqtt::bridge::lib::Bridge::addMqtt(), mqtt::bridge::lib::SSEDistributor::bridgesStarted(), mqtt::bridge::lib::Broker::getBridge(), and mqtt::bridge::lib::SSEDistributor::instance().
Referenced by mqtt::bridge::lib::Mqtt::onConnack().
| void mqtt::bridge::lib::BridgeStore::mqttDisconnected | ( | Broker & | broker, |
| mqtt::bridge::lib::Mqtt * | mqtt ) const |
Definition at line 247 of file BridgeStore.cpp.
References mqtt::bridge::lib::Broker::getBridge(), and mqtt::bridge::lib::Bridge::removeMqtt().
Referenced by mqtt::bridge::lib::Mqtt::onDisconnected().
|
delete |
|
delete |
| bool mqtt::bridge::lib::BridgeStore::patch | ( | const nlohmann::json & | jsonPatch | ) |
Definition at line 134 of file BridgeStore.cpp.
References bridgesConfigJsonActive, bridgesConfigJsonStaged, nlohmann::json_schema::json_validator::validate(), and validator.
|
private |
Definition at line 88 of file BridgeStore.h.
Referenced by activateStaged(), getBridgeMap(), getBroker(), and loadAndValidate().
|
private |
Definition at line 90 of file BridgeStore.h.
Referenced by activateStaged(), getBridgesConfigJson(), loadAndValidate(), and patch().
|
private |
Definition at line 91 of file BridgeStore.h.
Referenced by activateStaged(), loadAndValidate(), and patch().
|
private |
Definition at line 94 of file BridgeStore.h.
Referenced by activateStaged(), and loadAndValidate().
|
private |
Definition at line 92 of file BridgeStore.h.
Referenced by loadAndValidate(), and patch().