Qore jni Module 2.3.1
Loading...
Searching...
No Matches
MqttDataProvider::MqttDataProvider Class Reference

Event- and message-based data provider for MQTT client-side events. More...

#include <MqttDataProvider.qc.dox.h>

Inherits DataProvider::AbstractDataProvider, and DataProvider::DelayedObservable.

Public Member Methods

 constructor (*hash< auto > options)
 Creates the object from constructor options.
 
 observersReady ()
 Called when all observers have been added to the object. More...
 
hash< DataProvider::DataProviderInfo > getStaticInfoImpl ()
 Returns data provider static info.
 

Public Attributes

const ProviderInfo
 Provider info.
 
const ConstructorOptions
 Constructor options.
 
const EVENT_MQTT_MESSAGE = "mqtt-message-event"
 MQTT message event constant.
 
const MESSAGE_MQTT_MESSAGE = "message"
 MQTT message type. More...
 

Private Member Methods

 start ()
 Connects and starts receiving messages.
 
 connect ()
 Connects to the server if necessar.
 
 messageReceived (Method method, *list< auto > args)
 Qore callback for IMqttMessageListener.messageArrived(java.lang.String topic, MqttMessage message)
 
hash< string, hash< DataProviderMessageInfo > > getEventTypesImpl ()
 Returns a hash of all supported event types. More...
 
hash< string, hash< DataProviderMessageInfo > > getMessageTypesImpl ()
 Returns the description of an outbound message, if any. More...
 
 sendMessageImpl (string message_id, auto msg, *hash< auto > send_message_options)
 Sends a message from message-capable data providers. More...
 

Static Private Member Methods

static hash< auto > getClient (hash< auto > copts)
 Returns a client for the given options.
 

Private Attributes

MqttClient client
 The MQTT client itself.
 
MqttConnectOptions opts
 Connection options.
 
string topic
 Subscription topic filter.
 
int qos
 Subscription QoS.
 

Detailed Description

Event- and message-based data provider for MQTT client-side events.

Member Function Documentation

◆ getEventTypesImpl()

hash< string, hash< DataProviderMessageInfo > > MqttDataProvider::MqttDataProvider::getEventTypesImpl ( )
private

Returns a hash of all supported event types.

Returns
a hash of all supported event types
Note
only called if the provider supports the observer pattern / event API

◆ getMessageTypesImpl()

hash< string, hash< DataProviderMessageInfo > > MqttDataProvider::MqttDataProvider::getMessageTypesImpl ( )
private

Returns the description of an outbound message, if any.

Returns
the message type for this provider
Note
only called if the provider supports sending messages

◆ observersReady()

MqttDataProvider::MqttDataProvider::observersReady ( )

Called when all observers have been added to the object.

This method is meant to trigger event generation

◆ sendMessageImpl()

MqttDataProvider::MqttDataProvider::sendMessageImpl ( string  message_id,
auto  msg,
*hash< auto >  send_message_options 
)
private

Sends a message from message-capable data providers.

Parameters
msgthe message to send
send_message_optionsthe options for sending the message

Member Data Documentation

◆ MESSAGE_MQTT_MESSAGE

const MqttDataProvider::MqttDataProvider::MESSAGE_MQTT_MESSAGE = "message"

MQTT message type.

Publishes an MQTT message to the given topic


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