MQTTSuite
Loading...
Searching...
No Matches
mqtt::bridge::lib::Broker Class Reference

#include <Broker.h>

Collaboration diagram for mqtt::bridge::lib::Broker:

Public Member Functions

 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)
 Broker (Broker &&)=default
 Broker (const Broker &)=delete
BridgegetBridge () const
const std::string & getSessionStoreFileName () const
const std::string & getClientId () const
uint16_t getKeepAlive () const
bool getCleanSession () const
const std::string & getWillTopic () const
const std::string & getWillMessage () const
uint8_t getWillQoS () const
bool getWillRetain () const
const std::string & getUsername () const
const std::string & getPassword () const
bool getLoopPrevention () const
const std::string & getName () const
const std::string & getProtocol () const
const std::string & getEncryption () const
const std::string & getTransport () const
const std::string & getPrefix () const
bool getDisabled () const
const std::list< iot::mqtt::Topic > & getTopics () const
const nlohmann::json & getAddress () const

Private Attributes

Bridgebridge
std::string sessionStoreFileName
std::string instanceName
std::string protocol
std::string encryption
std::string transport
nlohmann::json address
std::string clientId
uint16_t keepAlive
bool cleanSession
std::string willTopic
std::string willMessage
uint8_t willQoS
bool willRetain
std::string username
std::string password
bool loopPrevention
std::string prefix
bool disabled
std::list< iot::mqtt::Topic > topics

Detailed Description

Definition at line 63 of file Broker.h.

Constructor & Destructor Documentation

◆ Broker() [1/3]

mqtt::bridge::lib::Broker::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 at line 52 of file Broker.cpp.

72 : bridge(bridge)
74 , instanceName(std::move(instanceName))
86 , username(userName)
87 , password(passWord)
89 , prefix(prefix)
91 , topics(topics) {
92 }
std::list< iot::mqtt::Topic > topics
Definition Broker.h:140
std::string willMessage
Definition Broker.h:130
nlohmann::json address
Definition Broker.h:124
std::string instanceName
Definition Broker.h:120
std::string sessionStoreFileName
Definition Broker.h:118
std::string transport
Definition Broker.h:123
std::string willTopic
Definition Broker.h:129
std::string encryption
Definition Broker.h:122

References address, bridge, cleanSession, clientId, disabled, encryption, instanceName, keepAlive, loopPrevention, password, prefix, protocol, sessionStoreFileName, topics, transport, username, willMessage, willQoS, willRetain, and willTopic.

◆ Broker() [2/3]

mqtt::bridge::lib::Broker::Broker ( Broker && )
default

◆ Broker() [3/3]

mqtt::bridge::lib::Broker::Broker ( const Broker & )
delete

Member Function Documentation

◆ getAddress()

const nlohmann::json & mqtt::bridge::lib::Broker::getAddress ( ) const

Definition at line 170 of file Broker.cpp.

170 {
171 return address;
172 }

References address.

◆ getBridge()

Bridge & mqtt::bridge::lib::Broker::getBridge ( ) const

Definition at line 94 of file Broker.cpp.

94 {
95 return bridge;
96 }

References bridge.

Referenced by addBridgeBrokerConnection(), closeBridgeBrokerConnection(), mqtt::bridge::SocketContextFactory::create(), mqtt::mqttbridge::websocket::SubProtocolFactory::create(), delBridgeBrokerConnection(), mqtt::bridge::lib::Mqtt::onConnack(), mqtt::bridge::lib::Mqtt::onDisconnected(), and mqtt::bridge::lib::Mqtt::onPublish().

Here is the caller graph for this function:

◆ getCleanSession()

bool mqtt::bridge::lib::Broker::getCleanSession ( ) const

Definition at line 110 of file Broker.cpp.

110 {
111 return cleanSession;
112 }

References cleanSession.

Referenced by mqtt::bridge::lib::Mqtt::Mqtt(), and mqtt::bridge::lib::Mqtt::onConnected().

Here is the caller graph for this function:

◆ getClientId()

const std::string & mqtt::bridge::lib::Broker::getClientId ( ) const

Definition at line 102 of file Broker.cpp.

102 {
103 return clientId;
104 }

References clientId.

Referenced by mqtt::bridge::SocketContextFactory::create(), mqtt::mqttbridge::websocket::SubProtocolFactory::create(), and mqtt::bridge::lib::Mqtt::Mqtt().

Here is the caller graph for this function:

◆ getDisabled()

bool mqtt::bridge::lib::Broker::getDisabled ( ) const

Definition at line 162 of file Broker.cpp.

162 {
163 return disabled;
164 }

References disabled.

◆ getEncryption()

const std::string & mqtt::bridge::lib::Broker::getEncryption ( ) const

Definition at line 150 of file Broker.cpp.

150 {
151 return encryption;
152 }

References encryption.

Referenced by mqtt::bridge::SocketContextFactory::create(), and mqtt::mqttbridge::websocket::SubProtocolFactory::create().

Here is the caller graph for this function:

◆ getKeepAlive()

uint16_t mqtt::bridge::lib::Broker::getKeepAlive ( ) const

Definition at line 106 of file Broker.cpp.

106 {
107 return keepAlive;
108 }

References keepAlive.

Referenced by mqtt::bridge::lib::Mqtt::Mqtt().

Here is the caller graph for this function:

◆ getLoopPrevention()

bool mqtt::bridge::lib::Broker::getLoopPrevention ( ) const

Definition at line 138 of file Broker.cpp.

138 {
139 return loopPrevention;
140 }

References loopPrevention.

Referenced by mqtt::bridge::lib::Mqtt::Mqtt(), and mqtt::bridge::lib::Mqtt::onConnected().

Here is the caller graph for this function:

◆ getName()

const std::string & mqtt::bridge::lib::Broker::getName ( ) const

Definition at line 142 of file Broker.cpp.

142 {
143 return instanceName;
144 }

References instanceName.

Referenced by mqtt::bridge::SocketContextFactory::create(), and mqtt::mqttbridge::websocket::SubProtocolFactory::create().

Here is the caller graph for this function:

◆ getPassword()

const std::string & mqtt::bridge::lib::Broker::getPassword ( ) const

Definition at line 134 of file Broker.cpp.

134 {
135 return password;
136 }

References password.

Referenced by mqtt::bridge::lib::Mqtt::Mqtt(), and mqtt::bridge::lib::Mqtt::onConnected().

Here is the caller graph for this function:

◆ getPrefix()

const std::string & mqtt::bridge::lib::Broker::getPrefix ( ) const

Definition at line 158 of file Broker.cpp.

158 {
159 return prefix;
160 }

References prefix.

Referenced by mqtt::bridge::lib::Mqtt::Mqtt(), and mqtt::bridge::lib::Bridge::publish().

Here is the caller graph for this function:

◆ getProtocol()

const std::string & mqtt::bridge::lib::Broker::getProtocol ( ) const

Definition at line 146 of file Broker.cpp.

146 {
147 return protocol;
148 }

References protocol.

Referenced by mqtt::bridge::SocketContextFactory::create(), and mqtt::mqttbridge::websocket::SubProtocolFactory::create().

Here is the caller graph for this function:

◆ getSessionStoreFileName()

const std::string & mqtt::bridge::lib::Broker::getSessionStoreFileName ( ) const

Definition at line 98 of file Broker.cpp.

98 {
100 }

References sessionStoreFileName.

Referenced by mqtt::bridge::lib::Mqtt::Mqtt().

Here is the caller graph for this function:

◆ getTopics()

const std::list< iot::mqtt::Topic > & mqtt::bridge::lib::Broker::getTopics ( ) const

Definition at line 166 of file Broker.cpp.

166 {
167 return topics;
168 }

References topics.

Referenced by mqtt::bridge::SocketContextFactory::create(), mqtt::mqttbridge::websocket::SubProtocolFactory::create(), and mqtt::bridge::lib::Mqtt::onConnack().

Here is the caller graph for this function:

◆ getTransport()

const std::string & mqtt::bridge::lib::Broker::getTransport ( ) const

Definition at line 154 of file Broker.cpp.

154 {
155 return transport;
156 }

References transport.

Referenced by mqtt::bridge::SocketContextFactory::create(), and mqtt::mqttbridge::websocket::SubProtocolFactory::create().

Here is the caller graph for this function:

◆ getUsername()

const std::string & mqtt::bridge::lib::Broker::getUsername ( ) const

Definition at line 130 of file Broker.cpp.

130 {
131 return username;
132 }

References username.

Referenced by mqtt::bridge::lib::Mqtt::Mqtt(), and mqtt::bridge::lib::Mqtt::onConnected().

Here is the caller graph for this function:

◆ getWillMessage()

const std::string & mqtt::bridge::lib::Broker::getWillMessage ( ) const

Definition at line 118 of file Broker.cpp.

118 {
119 return willMessage;
120 }

References willMessage.

Referenced by mqtt::bridge::lib::Mqtt::Mqtt(), and mqtt::bridge::lib::Mqtt::onConnected().

Here is the caller graph for this function:

◆ getWillQoS()

uint8_t mqtt::bridge::lib::Broker::getWillQoS ( ) const

Definition at line 122 of file Broker.cpp.

122 {
123 return willQoS;
124 }

References willQoS.

Referenced by mqtt::bridge::lib::Mqtt::Mqtt(), and mqtt::bridge::lib::Mqtt::onConnected().

Here is the caller graph for this function:

◆ getWillRetain()

bool mqtt::bridge::lib::Broker::getWillRetain ( ) const

Definition at line 126 of file Broker.cpp.

126 {
127 return willRetain;
128 }

References willRetain.

Referenced by mqtt::bridge::lib::Mqtt::Mqtt(), and mqtt::bridge::lib::Mqtt::onConnected().

Here is the caller graph for this function:

◆ getWillTopic()

const std::string & mqtt::bridge::lib::Broker::getWillTopic ( ) const

Definition at line 114 of file Broker.cpp.

114 {
115 return willTopic;
116 }

References willTopic.

Referenced by mqtt::bridge::lib::Mqtt::Mqtt(), and mqtt::bridge::lib::Mqtt::onConnected().

Here is the caller graph for this function:

Member Data Documentation

◆ address

nlohmann::json mqtt::bridge::lib::Broker::address
private

Definition at line 124 of file Broker.h.

Referenced by Broker(), and getAddress().

◆ bridge

Bridge& mqtt::bridge::lib::Broker::bridge
private

Definition at line 117 of file Broker.h.

Referenced by Broker(), and getBridge().

◆ cleanSession

bool mqtt::bridge::lib::Broker::cleanSession
private

Definition at line 128 of file Broker.h.

Referenced by Broker(), and getCleanSession().

◆ clientId

std::string mqtt::bridge::lib::Broker::clientId
private

Definition at line 126 of file Broker.h.

Referenced by Broker(), and getClientId().

◆ disabled

bool mqtt::bridge::lib::Broker::disabled
private

Definition at line 138 of file Broker.h.

Referenced by Broker(), and getDisabled().

◆ encryption

std::string mqtt::bridge::lib::Broker::encryption
private

Definition at line 122 of file Broker.h.

Referenced by Broker(), and getEncryption().

◆ instanceName

std::string mqtt::bridge::lib::Broker::instanceName
private

Definition at line 120 of file Broker.h.

Referenced by Broker(), and getName().

◆ keepAlive

uint16_t mqtt::bridge::lib::Broker::keepAlive
private

Definition at line 127 of file Broker.h.

Referenced by Broker(), and getKeepAlive().

◆ loopPrevention

bool mqtt::bridge::lib::Broker::loopPrevention
private

Definition at line 135 of file Broker.h.

Referenced by Broker(), and getLoopPrevention().

◆ password

std::string mqtt::bridge::lib::Broker::password
private

Definition at line 134 of file Broker.h.

Referenced by Broker(), and getPassword().

◆ prefix

std::string mqtt::bridge::lib::Broker::prefix
private

Definition at line 137 of file Broker.h.

Referenced by Broker(), and getPrefix().

◆ protocol

std::string mqtt::bridge::lib::Broker::protocol
private

Definition at line 121 of file Broker.h.

Referenced by Broker(), and getProtocol().

◆ sessionStoreFileName

std::string mqtt::bridge::lib::Broker::sessionStoreFileName
private

Definition at line 118 of file Broker.h.

Referenced by Broker(), and getSessionStoreFileName().

◆ topics

std::list<iot::mqtt::Topic> mqtt::bridge::lib::Broker::topics
private

Definition at line 140 of file Broker.h.

Referenced by Broker(), and getTopics().

◆ transport

std::string mqtt::bridge::lib::Broker::transport
private

Definition at line 123 of file Broker.h.

Referenced by Broker(), and getTransport().

◆ username

std::string mqtt::bridge::lib::Broker::username
private

Definition at line 133 of file Broker.h.

Referenced by Broker(), and getUsername().

◆ willMessage

std::string mqtt::bridge::lib::Broker::willMessage
private

Definition at line 130 of file Broker.h.

Referenced by Broker(), and getWillMessage().

◆ willQoS

uint8_t mqtt::bridge::lib::Broker::willQoS
private

Definition at line 131 of file Broker.h.

Referenced by Broker(), and getWillQoS().

◆ willRetain

bool mqtt::bridge::lib::Broker::willRetain
private

Definition at line 132 of file Broker.h.

Referenced by Broker(), and getWillRetain().

◆ willTopic

std::string mqtt::bridge::lib::Broker::willTopic
private

Definition at line 129 of file Broker.h.

Referenced by Broker(), and getWillTopic().


The documentation for this class was generated from the following files: