MQTTSuite
Loading...
Searching...
No Matches
mqtt::mqttintegrator::SocketContextFactory Class Reference

#include <SocketContextFactory.h>

Inheritance diagram for mqtt::mqttintegrator::SocketContextFactory:
Collaboration diagram for mqtt::mqttintegrator::SocketContextFactory:

Public Member Functions

 SocketContextFactory (const std::string &sessionStoreFileName)
core::socket::stream::SocketContext * create (core::socket::stream::SocketConnection *socketConnection) final

Private Attributes

std::string sessionStoreFileName

Detailed Description

Definition at line 54 of file SocketContextFactory.h.

Constructor & Destructor Documentation

◆ SocketContextFactory()

mqtt::mqttintegrator::SocketContextFactory::SocketContextFactory ( const std::string & sessionStoreFileName)
explicit

Member Function Documentation

◆ create()

core::socket::stream::SocketContext * mqtt::mqttintegrator::SocketContextFactory::create ( core::socket::stream::SocketConnection * socketConnection)
final

Definition at line 65 of file SocketContextFactory.cpp.

65 {
66 iot::mqtt::SocketContext* socketContext = nullptr;
67
68 nlohmann::json& mappingJson =
69 mqtt::lib::JsonMappingReader::readMappingFromFile(utils::Config::getStringOptionValue("--mqtt-mapping-file"));
70
71 if (mappingJson.contains("connection")) {
72 socketContext = new iot::mqtt::SocketContext(
73 socketConnection,
74 new mqtt::mqttintegrator::lib::Mqtt(
75 socketConnection->getConnectionName(), mappingJson["connection"], mappingJson["mapping"], sessionStoreFileName));
76 }
77
78 return socketContext;
79 }
static nlohmann::json & readMappingFromFile(const std::string &mapFilePath)

References mqtt::mqttintegrator::lib::Mqtt::Mqtt(), mqtt::lib::JsonMappingReader::readMappingFromFile(), and sessionStoreFileName.

Here is the call graph for this function:

Member Data Documentation

◆ sessionStoreFileName

std::string mqtt::mqttintegrator::SocketContextFactory::sessionStoreFileName
private

Definition at line 61 of file SocketContextFactory.h.

Referenced by create(), and SocketContextFactory().


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