2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
42#ifndef MQTTBROKER_LIB_MQTTMAPPER_H
43#define MQTTBROKER_LIB_MQTTMAPPER_H
49#include <iot/mqtt/packets/Publish.h>
50#include <utils/Timeval.h>
52#ifndef DOXYGEN_SHOULD_SKIP_THIS
60#include <nlohmann/json.hpp>
84 using ConnectParameter = std::tuple<
bool, std::string, std::string, uint8_t,
bool, std::string, std::string>;
125 const std::string& topic,
const std::string& message, uint8_t qoS,
bool retain,
double delay,
MappedPublishes& mappedPublishes);
Class for changing the configuration.
std::string getMapping(int indent=2) const
bool loadMapping(const std::string mapFilename)
CLI::Option * sessionStoreOpt
std::string getMappingFilename() const
bool setMapping(const std::string &mapping) const
const std::shared_ptr< MqttMapper > getMqttMapper() const
bool setMappingFile(const std::string &mapFilename)
bool persistMapping() const
ConfigApplication & setSessionStore(const std::string &sessionStore)
ConfigApplication(utils::SubCommand *parent, ConcretConfigApplicationT *concretConfigApplication)
CLI::Option * mappingFileOpt
~ConfigApplication() override
std::shared_ptr< MqttMapper > mqttMapper
std::string getSessionStore() const
ConfigMqttBroker & setHtmlRoot(const std::string &htmlRoot)
std::string getHtmlRoot()
CLI::Option * htmlRootOpt
static constexpr std::string_view NAME
ConfigMqttBroker(utils::SubCommand *parent)
static constexpr std::string_view DESCRIPTION
~ConfigMqttBroker() override
static constexpr std::string_view DESCRIPTION
static constexpr std::string_view NAME
~ConfigMqttIntegrator() override
ConfigMqttIntegrator(utils::SubCommand *parent)
static void extractSubscription(const nlohmann::json &topicLevelJson, const std::string &topic, std::list< iot::mqtt::Topic > &topicList)
MqttMapper & operator=(const MqttMapper &)=delete
void getTemplateMappings(const nlohmann::json &templateMapping, nlohmann::json &json, const iot::mqtt::packets::Publish &publish, MappedPublishes &mappedPublishes) const
std::string getClientId() const
std::tuple< bool, std::string, std::string, uint8_t, bool, std::string, std::string > ConnectParameter
std::list< iot::mqtt::Topic > extractSubscriptions() const
MappedPublishes getMappings(const iot::mqtt::packets::Publish &publish)
nlohmann::json mappingJson
uint16_t getKeepAlive() const
bool setMapping(nlohmann::json mappingJson)
static const nlohmann::json validate(const nlohmann::json &json)
ConnectParameter getConnectPayload() const
static const nlohmann::json_schema::json_validator validator
std::list< void * > pluginHandles
static const nlohmann::json validate(const nlohmann::json &json, nlohmann::json_schema::basic_error_handler &err)
nlohmann::json mappingJsonUnpatched
static const std::string mappingJsonSchemaString
static void getMappedMessage(const std::string &topic, const std::string &message, uint8_t qoS, bool retain, double delay, MappedPublishes &mappedPublishes)
const nlohmann::json & getMapping() const
void getMappedTemplate(const nlohmann::json &templateMapping, nlohmann::json &json, MappedPublishes &mappedPublishes) const
std::tuple< std::vector< iot::mqtt::packets::Publish >, std::vector< ScheduledPublish > > MappedPublishes
inja::Environment * injaEnvironment
static void getStaticMappings(const nlohmann::json &staticMapping, const iot::mqtt::packets::Publish &publish, MappedPublishes &mappedPublishes)
static const std::string & getSchema()
static void getMappedMessage(const nlohmann::json &staticMapping, const iot::mqtt::packets::Publish &publish, MappedPublishes &mappedPublishes)
MqttMapper(const MqttMapper &)=delete
nlohmann::json findMatchingTopicLevel(const nlohmann::json &topicLevel, const std::string &topic) const
static void extractSubscriptions(const nlohmann::json &mappingJson, const std::string &topic, std::list< iot::mqtt::Topic > &topicList)
iot::mqtt::packets::Publish publish