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

GWSOptimisticExporter implements exporting via GWSConnector. It wraps the given SensorData instances and pass them to the GWSConnector::send(). It also keeps track of the connectivity to the remote server. Exporting is implemented optimistically, we assume no network failures. If the number of non-confirmed exports reached the limit exportNonConfirmed, no more exports occures until a confirmation comes. More...

#include <GWSOptimisticExporter.h>

Inheritance diagram for BeeeOn::GWSOptimisticExporter:
BeeeOn::Exporter BeeeOn::GWSListener BeeeOn::Loggable

Public Types

typedef Poco::SharedPtr
< GWSOptimisticExporter
Ptr
 
- Public Types inherited from BeeeOn::GWSListener
typedef Poco::SharedPtr
< GWSListener
Ptr
 

Public Member Functions

void setConnector (GWSConnector::Ptr connector)
 
void setExportNonConfirmed (int count)
 
bool ship (const SensorData &data) override
 Ship the given data via GWSConnector::send() to the remote server. The connectivity status of the GWSConnector is considered. More...
 
void onOther (const GWMessage::Ptr message) override
 Process confirmations of exported data.
 
void onConnected (const GWSListener::Address &) override
 Notice that the GWSConnector is connected.
 
void onDisconnected (const GWSListener::Address &) override
 Notice that the GWSConnector is disconnected.
 
- Public Member Functions inherited from BeeeOn::GWSListener
virtual void onRequest (const GWRequest::Ptr request)
 When a request is received, this event is fired.
 
virtual void onResponse (const GWResponse::Ptr response)
 When a response is received, this event is fired.
 
virtual void onAck (const GWAck::Ptr ack)
 When an ack is received, this event is fired.
 
virtual void onTrySend (const GWMessage::Ptr message)
 Fire when a message is about to be sent to the server. After the send is successful (no network failure), the GWSListener::onSend() event would be generated as well.
 
virtual void onSent (const GWMessage::Ptr message)
 Fire when a message is being sent to the server. There might be a delay between putting a messing into an output queue and the actual sending process. This event allows to track such delay.
 

Detailed Description

GWSOptimisticExporter implements exporting via GWSConnector. It wraps the given SensorData instances and pass them to the GWSConnector::send(). It also keeps track of the connectivity to the remote server. Exporting is implemented optimistically, we assume no network failures. If the number of non-confirmed exports reached the limit exportNonConfirmed, no more exports occures until a confirmation comes.

Member Function Documentation

bool GWSOptimisticExporter::ship ( const SensorData data)
overridevirtual

Ship the given data via GWSConnector::send() to the remote server. The connectivity status of the GWSConnector is considered.

Returns
true if GWSConnector::send() succeeded, false if there is no connectivity, no confirmations for the configured number of outstanding exports or the GWSConnector::send() fails.

Implements BeeeOn::Exporter.


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