MQTTSuite
Loading...
Searching...
No Matches
Broker.cpp
Go to the documentation of this file.
1/*
2 * MQTTSuite - A lightweight MQTT Integration System
3 * Copyright (C) Volker Christian <me@vchrist.at>
4 * 2022, 2023, 2024, 2025
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the Free
8 * Software Foundation, either version 3 of the License, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
15 *
16 * You should have received a copy of the GNU General Public License along
17 * with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20/*
21 * MIT License
22 *
23 * Permission is hereby granted, free of charge, to any person obtaining a copy
24 * of this software and associated documentation files (the "Software"), to deal
25 * in the Software without restriction, including without limitation the rights
26 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
27 * copies of the Software, and to permit persons to whom the Software is
28 * furnished to do so, subject to the following conditions:
29 *
30 * The above copyright notice and this permission notice shall be included in
31 * all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
34 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
35 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
36 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
37 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
38 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
39 * THE SOFTWARE.
40 */
41
42#include "Broker.h"
43
44#ifndef DOXYGEN_SHOULD_SKIP_THIS
45
46#include <utility>
47
48#endif // DOXYGEN_SHOULD_SKIP_THIS
49
50namespace mqtt::bridge::lib {
51
53 const std::string& sessionStoreFileName,
54 const std::string& instanceName,
55 const std::string& protocol,
56 const std::string& encryption,
57 const std::string& transport,
58 const nlohmann::json& address,
59 const std::string& clientId,
60 const uint16_t keepAlive,
61 bool cleanSession,
62 const std::string& willTopic,
63 const std::string& willMessage,
64 const uint8_t willQoS,
65 bool willRetain,
66 const std::string& userName,
67 const std::string& passWord,
68 bool loopPrevention,
69 const std::string& prefix,
70 bool disabled,
71 const std::list<iot::mqtt::Topic>& topics)
72 : bridge(bridge)
73 , sessionStoreFileName(sessionStoreFileName)
74 , instanceName(std::move(instanceName))
75 , protocol(protocol)
76 , encryption(encryption)
77 , transport(transport)
78 , address(address)
79 , clientId(clientId)
80 , keepAlive(keepAlive)
81 , cleanSession(cleanSession)
82 , willTopic(willTopic)
83 , willMessage(willMessage)
84 , willQoS(willQoS)
85 , willRetain(willRetain)
86 , username(userName)
87 , password(passWord)
88 , loopPrevention(loopPrevention)
89 , prefix(prefix)
90 , disabled(disabled)
91 , topics(topics) {
92 }
93
95 return bridge;
96 }
97
98 const std::string& Broker::getSessionStoreFileName() const {
100 }
101
102 const std::string& Broker::getClientId() const {
103 return clientId;
104 }
105
106 uint16_t Broker::getKeepAlive() const {
107 return keepAlive;
108 }
109
110 bool Broker::getCleanSession() const {
111 return cleanSession;
112 }
113
114 const std::string& Broker::getWillTopic() const {
115 return willTopic;
116 }
117
118 const std::string& Broker::getWillMessage() const {
119 return willMessage;
120 }
121
122 uint8_t Broker::getWillQoS() const {
123 return willQoS;
124 }
125
126 bool Broker::getWillRetain() const {
127 return willRetain;
128 }
129
130 const std::string& Broker::getUsername() const {
131 return username;
132 }
133
134 const std::string& Broker::getPassword() const {
135 return password;
136 }
137
138 bool Broker::getLoopPrevention() const {
139 return loopPrevention;
140 }
141
142 const std::string& Broker::getName() const {
143 return instanceName;
144 }
145
146 const std::string& Broker::getProtocol() const {
147 return protocol;
148 }
149
150 const std::string& Broker::getEncryption() const {
151 return encryption;
152 }
153
154 const std::string& Broker::getTransport() const {
155 return transport;
156 }
157
158 const std::string& Broker::getPrefix() const {
159 return prefix;
160 }
161
162 bool Broker::getDisabled() const {
163 return disabled;
164 }
165
166 const std::list<iot::mqtt::Topic>& Broker::getTopics() const {
167 return topics;
168 }
169
170 const nlohmann::json& Broker::getAddress() const {
171 return address;
172 }
173
174} // namespace mqtt::bridge::lib
const std::string & getName() const
Definition Broker.cpp:142
bool getLoopPrevention() const
Definition Broker.cpp:138
const nlohmann::json & getAddress() const
Definition Broker.cpp:170
bool getDisabled() const
Definition Broker.cpp:162
const std::string & getWillTopic() const
Definition Broker.cpp:114
bool getWillRetain() const
Definition Broker.cpp:126
const std::list< iot::mqtt::Topic > & getTopics() const
Definition Broker.cpp:166
std::list< iot::mqtt::Topic > topics
Definition Broker.h:140
uint16_t getKeepAlive() const
Definition Broker.cpp:106
std::string willMessage
Definition Broker.h:130
nlohmann::json address
Definition Broker.h:124
const std::string & getWillMessage() const
Definition Broker.cpp:118
const std::string & getSessionStoreFileName() const
Definition Broker.cpp:98
const std::string & getClientId() const
Definition Broker.cpp:102
const std::string & getEncryption() const
Definition Broker.cpp:150
const std::string & getUsername() const
Definition Broker.cpp:130
bool getCleanSession() const
Definition Broker.cpp:110
Broker(Bridge &bridge, const std::string &sessionStoreFileName, const std::string &instanceName, const std::string &protocol, const std::string &encryption, const std::string &transport, const nlohmann::json &address, const std::string &clientId, const uint16_t keepAlive, bool cleanSession, const std::string &willTopic, const std::string &willMessage, const uint8_t willQoS, bool willRetain, const std::string &username, const std::string &password, bool loopPrevention, const std::string &prefix, bool disabled, const std::list< iot::mqtt::Topic > &topics)
Definition Broker.cpp:52
const std::string & getPassword() const
Definition Broker.cpp:134
std::string instanceName
Definition Broker.h:120
const std::string & getProtocol() const
Definition Broker.cpp:146
std::string sessionStoreFileName
Definition Broker.h:118
const std::string & getTransport() const
Definition Broker.cpp:154
std::string transport
Definition Broker.h:123
std::string willTopic
Definition Broker.h:129
Bridge & getBridge() const
Definition Broker.cpp:94
const std::string & getPrefix() const
Definition Broker.cpp:158
uint8_t getWillQoS() const
Definition Broker.cpp:122
std::string encryption
Definition Broker.h:122