IQRF Gateway Daemon
|
Object factory to create DpaTask objects from incoming messages. More...
#include <JsonSerializer.h>
Public Member Functions | |
JsonSerializer () | |
JsonSerializer (const std::string &name) | |
virtual | ~JsonSerializer () |
const std::string & | getName () const override |
returns instance name More... | |
std::string | parseCategory (const std::string &request) override |
ISerializer overriden methods. More... | |
std::unique_ptr< DpaTask > | parseRequest (const std::string &request) override |
Parse DPA request. More... | |
std::string | parseConfig (const std::string &request) override |
Parse confiquration request. More... | |
std::string | encodeConfig (const std::string &request, const std::string &response) override |
Encode confiquration response. More... | |
std::string | getLastError () const override |
Get last error string. More... | |
std::string | encodeAsyncAsDpaRaw (const DpaMessage &dpaMessage) const override |
Encode Asynchronous DPA message. More... | |
![]() | |
std::unique_ptr< DpaTask > | createObject (const std::string &id, rapidjson::Value &representation) |
Create object based on data representation. More... | |
void | registerClass (const std::string &id) |
Template function to register object creator function. More... | |
bool | hasClass (const std::string &id) |
Check if a creator object is registered. More... | |
![]() | |
virtual | ~ISerializer () |
Object factory to create DpaTask objects from incoming messages.
Uses inherited ObjectFactory features to create DpaTask object from incoming JSON messages.
JsonSerializer::JsonSerializer | ( | ) |
JsonSerializer::JsonSerializer | ( | const std::string & | name | ) |
parametric constructor
[in] | name | instance name |
|
inlinevirtual |
|
overridevirtual |
Encode Asynchronous DPA message.
[in] | dpaMessage | message to be encoded |
Passed asynchronous DPA message is serialized in an appropriate form.
Implements ISerializer.
|
overridevirtual |
Encode confiquration response.
[in] | request | original configuration request |
[in] | response | string with response phrase |
Encode configuration response based on original configuration request and passed response phrase.
Implements ISerializer.
|
overridevirtual |
Get last error string.
Serializer sets last error string as the result of last serialization.
Implements ISerializer.
|
inlineoverridevirtual |
returns instance name
Implements ISerializer.
|
overridevirtual |
ISerializer overriden methods.
Implements ISerializer.
|
overridevirtual |
Parse confiquration request.
[in] | request | configuration request |
It expects incoming configuration request (detected by parseCategory). It parses the request and return configuration string. The only switch mode forwarding | operational | service is supported now. Returned string may be empty in case of error.
Implements ISerializer.
|
overridevirtual |
Parse DPA request.
[in] | request | incoming DPA request |
It expects incoming DPA request (detected by parseCategory). It parses DPA request and create DpaTask. DpaTask may be empty in case of error.
Implements ISerializer.