2
3
4
5
6
7
8
9
10
12#ifndef MQTTSTORE_LIB_MQTTMESSAGE_H
13#define MQTTSTORE_LIB_MQTTMESSAGE_H
18namespace mqtt::mqttstore::
lib {
static std::string quoteIdentifier(const std::string &identifier)
std::string connectionName
static std::string buildRawInsertSql(const std::string &rawTable, const MqttMessage &message, const std::optional< nlohmann::json > &payloadJson)
static std::string jsonValueForColumn(const StoragePlan::ColumnMapping &mapping, const MqttMessage &message, const nlohmann::json &payloadJson)
static std::string sqlValue(const nlohmann::json &value)
static bool hasBinaryContent(const std::string &payload)
MariaDbStorage(const std::string &connectionName, const ConnectionConfig &connectionConfig, std::string rawTable, bool autoCreateRawTable, StoragePlan storagePlan)
static bool isSafeIdentifier(const std::string &identifier)
void storeProjections(const MqttMessage &message, const std::optional< nlohmann::json > &payloadJson)
static std::string buildProjectionInsertSql(const StoragePlan::Projection &projection, const MqttMessage &message, const nlohmann::json &payloadJson)
database::mariadb::MariaDBClient mariaDB
static std::optional< nlohmann::json > parsePayload(const std::string &payload)
void store(const MqttMessage &message)
static void execLogFailure(const std::string &connectionName, const std::string &operation, const std::string &errorString, unsigned int errorNumber)
static std::string sqlQuote(const std::string &value)
const std::string willTopic
Mqtt(const std::string &connectionName, const std::string &clientId, std::uint8_t qoSDefault, std::uint16_t keepAlive, bool cleanSession, const std::string &willTopic, const std::string &willMessage, std::uint8_t willQoS, bool willRetain, const std::string &username, const std::string &password, const std::list< std::string > &subTopics, MariaDbStorage::ConnectionConfig connectionConfig, const std::string &rawTable, bool autoCreateRawTable, StoragePlan storagePlan, const std::string &sessionStoreFileName="")
const std::uint8_t qoSDefault
void onConnack(const iot::mqtt::packets::Connack &connack) final
const std::string willMessage
iot::mqtt::client::Mqtt Super
const std::uint8_t willQoS
bool onSignal(int signum) final
const std::list< std::string > subTopics
void onPublish(const iot::mqtt::packets::Publish &publish) final
const std::string username
const std::string password
static std::uint8_t getQos(const std::string &qoSString)
void onSuback(const iot::mqtt::packets::Suback &suback) final
const std::vector< Projection > & getProjections() const
std::vector< const Projection * > match(const std::string &topic) const
static StoragePlan fromJson(const nlohmann::json &json)
static StoragePlan fromFile(const std::string &fileName)
static bool topicMatches(const std::string &filter, const std::string &topic)
std::vector< Projection > projections
std::uint16_t packetIdentifier
std::string connectionName
std::optional< std::size_t > topicLevel
std::optional< std::string > literal
std::vector< ColumnMapping > columns