BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Types | Public Member Functions
BeeeOn::GWNoticeRequest Class Reference

GWNoticeRequest allows a gateway to send a notice about something that happen. It can report progress information, error details, hints, etc. Each notice is defined by the following properties: More...

#include <GWNoticeRequest.h>

Inheritance diagram for BeeeOn::GWNoticeRequest:
BeeeOn::GWRequest BeeeOn::GWMessage

Public Types

typedef Poco::SharedPtr
< GWNoticeRequest
Ptr
 
- Public Types inherited from BeeeOn::GWRequest
typedef Poco::SharedPtr
< GWRequest
Ptr
 
- Public Types inherited from BeeeOn::GWMessage
typedef Poco::SharedPtr
< GWMessage
Ptr
 

Public Member Functions

 GWNoticeRequest (const Poco::JSON::Object::Ptr object)
 
void setAt (const Poco::Timestamp &at)
 
Poco::Timestamp at () const
 
void setSeverity (const Severity &severity)
 
Severity severity () const
 
void setKey (const std::string &key)
 
std::string key () const
 
void setContext (const Poco::JSON::Object::Ptr context)
 
Poco::JSON::Object::Ptr context () const
 
- Public Member Functions inherited from BeeeOn::GWRequest
template<typename T >
Poco::SharedPtr< T > derive (std::function< void(Poco::SharedPtr< T >)> f=[](Poco::SharedPtr< T >){}) const
 Derive the appropriate response and apply the given function to construct it.
 
GWResponse::Ptr derive (std::function< void(GWResponse::Ptr)> f=[](GWResponse::Ptr){}) const
 Derive the appropriate response and apply the given function to construct it.
 
- Public Member Functions inherited from BeeeOn::GWMessage
void setID (const GlobalID &id)
 Set unique identifier intended to match request message with its response.
 
GlobalID id () const
 Return unique identifier intended to match request message with its response.
 
GWMessageType type () const
 Returns the type of the message.
 
std::string toString () const
 Returns the string representation of the message.
 
std::string toBriefString () const
 

Additional Inherited Members

- Static Public Member Functions inherited from BeeeOn::GWMessage
static GWMessage::Ptr fromJSON (const std::string &json)
 Factory method for creating subclasses of the GWMessage from the json string. More...
 
static GWMessage::Ptr fromJSON (Poco::JSON::Object::Ptr object)
 Factory method for creating subclasses of the GWMessage from the JSON::Object. More...
 
- Protected Member Functions inherited from BeeeOn::GWRequest
 GWRequest (const GWMessageType::Raw &type)
 
 GWRequest (const Poco::JSON::Object::Ptr object)
 
virtual GWResponse::Ptr deriveResponse () const
 
GWResponse::Ptr deriveGenericResponse (GWResponse::Ptr response) const
 
- Protected Member Functions inherited from BeeeOn::GWMessage
 GWMessage (const GWMessageType::Raw &type)
 Constructs a GWMessage depending on the given type. More...
 
 GWMessage (const Poco::JSON::Object::Ptr object)
 Constructs a GWMessage from the JSON::Object.
 
Poco::JSON::Object::Ptr json () const
 

Detailed Description

GWNoticeRequest allows a gateway to send a notice about something that happen. It can report progress information, error details, hints, etc. Each notice is defined by the following properties:

All message should be designed with multi-locale environment in mind. Thus, the key and context are kept separately and should be tranformed to the appropriate user message on the presentation layer.

An example message:

{
  "id": "603a5085-1b00-4c5e-ac70-dde674a49b0c",
  "message_type": "notice_request",
  "at": 1546882536019124,
  "severity": "info",
  "key": "press_button_on_device",
  "context": {
    "device_id": "0xa3123456abcd01234",
    "gateway_id": "12437773180129",
    "button": "red"
  }
}

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