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>
121 const std::string& topic,
const std::string& message, uint8_t qoS,
bool retain,
double delay,
MappedPublishes& mappedPublishes);
Class for changing the configuration.
CLI::Option * sessionStoreOpt
std::string getMappingFilename() const
const std::shared_ptr< MqttMapper > getMqttMapper() const
bool setMappingFile(const std::string &mappingFile)
ConfigApplication & setSessionStore(const std::string &sessionStore)
ConfigApplication(utils::SubCommand *parent, ConcretConfigApplicationT *concretConfigApplication)
CLI::Option * mappingFileOpt
~ConfigApplication() override
std::shared_ptr< MqttMapper > mqttMapper
bool setMapping(const nlohmann::json &json)
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 nlohmann::json deployDraft(const std::string &mapFilePath)
static nlohmann::json rollbackTo(const std::string &mapFilePath, const std::string &versionId)
JsonMappingReader()=delete
static void discardDraft(const std::string &mapFilePath)
static std::vector< VersionEntry > getHistory(const std::string &mapFilePath)
static nlohmann::json readMappingFromFile(const std::string &mapFilePath)
static nlohmann::json readDraftOrActive(const std::string &mapFilePath)
static std::string getDraftPath(const std::string &mapFilePath)
static void saveDraft(const std::string &mapFilePath, const nlohmann::json &content)
static nlohmann::json getDefaultPatch(const nlohmann::json &inputJson)
static void extractSubscription(const nlohmann::json &topicLevelJson, const std::string &topic, std::list< iot::mqtt::Topic > &topicList)
MqttMapper & operator=(const MqttMapper &)=delete
std::list< iot::mqtt::Topic > extractSubscriptions() const
MappedPublishes getMappings(const iot::mqtt::packets::Publish &publish)
nlohmann::json findMatchingTopicLevel(const nlohmann::json &topicLevel, const std::string &topic)
nlohmann::json mappingJson
bool setMapping(nlohmann::json mappingJson)
static const nlohmann::json validate(const nlohmann::json &json)
std::pair< std::vector< iot::mqtt::packets::Publish >, std::vector< ScheduledPublish > > MappedPublishes
void getTemplateMappings(const nlohmann::json &templateMapping, nlohmann::json &json, const iot::mqtt::packets::Publish &publish, MappedPublishes &mappedPublishes)
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)
static void publishMappedMessage(const nlohmann::json &staticMapping, const iot::mqtt::packets::Publish &publish, MappedPublishes &mappedPublishes)
static const std::string mappingJsonSchemaString
const nlohmann::json & getMapping() const
inja::Environment * injaEnvironment
static void getStaticMappings(const nlohmann::json &staticMapping, const iot::mqtt::packets::Publish &publish, MappedPublishes &mappedPublishes)
static const std::string & getSchema()
MqttMapper(const MqttMapper &)=delete
const nlohmann::json & getConnection() const
static void publishMappedMessage(const std::string &topic, const std::string &message, uint8_t qoS, bool retain, double delay, MappedPublishes &mappedPublishes)
void publishMappedTemplate(const nlohmann::json &templateMapping, nlohmann::json &json, MappedPublishes &mappedPublishes)
static void extractSubscriptions(const nlohmann::json &mappingJson, const std::string &topic, std::list< iot::mqtt::Topic > &topicList)
iot::mqtt::packets::Publish publish