class for MQTT connections
More...
#include <MqttConnection.qc.dox.h>
Inherits ConnectionProvider::AbstractConnectionWithInfo.
|
| constructor (string name, string desc, string url, hash< auto > attr={}, hash< auto > options={}, *LoggerInterface logger) |
| Creates the object from the arguments.
|
|
| constructor (hash< auto > config, *hash< auto > attr) |
| Creates the object from the arguments.
|
|
string | getType () |
| returns the string type name for the connection object
|
|
bool | hasDataProvider () |
| Returns True, as this connection class returns a data provider with the getDataProvider() method.
|
|
AbstractDataProvider | getDataProvider (*hash< auto > constructor_options) |
| Returns a MqttDataProvider object for this connection.
|
|
|
static string | getType (hash< DataProviderOptionInfo > opt) |
| Returns the string type for the first data provider type.
|
|
|
const | ConnectionScheme = ... |
| Connection entry info.
|
|
|
hash< ConnectionSchemeInfo > | getConnectionSchemeInfoImpl () |
| Returns the ConnectionSchemeInfo hash for this object.
|
|
*hash< string, hash< DataProviderOptionInfo > > | getDataProviderConstructorOptionsImpl () |
| Returns a hash of data provider constructor option info, if applicable.
|
|
| setChildCapabilities () |
| Override to set child data provider capabilities once per child class.
|
|
MqttConnectionWrapper | getImpl (bool connect=True, *hash< auto > rtopts) |
| this method must return the connection object corresponding to the object's configuration
|
|
| setRealUrl (*string url) |
| Called by the constructor to set the real URL.
|
|
class for MQTT connections
supports the options from MqttDataProvider::ConstructorOptions
◆ constructor()
MqttDataProvider::MqttConnection::constructor |
( |
hash< auto > |
config, |
|
|
*hash< auto > |
attr |
|
) |
| |
Creates the object from the arguments.
- Parameters
-
config | with the following keys:
- name (required string): the connection name
- display_name (optional string): the display name
- short_desc (optional string): a short description in plain text
- desc (optional string): a long description with markdown formatting
- url (required string): the connection URL
- opts (optional hash): connection options
- logger (optional LoggerInterface object): logger for the connection
|
attr | optional connection attributes
- monitor (optional bool): should the connection be monitored? Default: True
- enabled (optional bool): is the connection enabled? Default: True
- locked (optional bool): is the connection locked? Default: False
- debug_data (optional bool): debug data? Default: False
- tags (optional hash): tags for the connection; no default value
|
- Exceptions
-
CONNECTION-OPTION-ERROR | missing or invalid connection option or attribute |
◆ getDataProvider()
AbstractDataProvider MqttDataProvider::MqttConnection::getDataProvider |
( |
*hash< auto > |
constructor_options | ) |
|
Returns a MqttDataProvider object for this connection.
- Parameters
-
constructor_options | any additional constructor options for the data provider |
- Returns
- a data provider object for this connection, if supported
◆ getDataProviderConstructorOptionsImpl()
*hash< string, hash< DataProviderOptionInfo > > MqttDataProvider::MqttConnection::getDataProviderConstructorOptionsImpl |
( |
| ) |
|
|
private |
Returns a hash of data provider constructor option info, if applicable.
- Returns
- a hash of data provider constructor option info for the primary data provider, if applicable
◆ getImpl()
MqttConnectionWrapper MqttDataProvider::MqttConnection::getImpl |
( |
bool |
connect = True , |
|
|
*hash< auto > |
rtopts |
|
) |
| |
|
private |
this method must return the connection object corresponding to the object's configuration
- Parameters
-
connect | if True then the connection should be returned connected (and if possible a round-trip "ping" of the server should be made) |
rtopts | options to override connection options |
- Returns
- the connection object
◆ hasDataProvider()
bool MqttDataProvider::MqttConnection::hasDataProvider |
( |
| ) |
|
◆ setRealUrl()
MqttDataProvider::MqttConnection::setRealUrl |
( |
*string |
url | ) |
|
|
private |
Called by the constructor to set the real URL.
@path the new URL
sets the real HTTP URL for HTTP-based connections
The documentation for this class was generated from the following file:
- doxygen/qlib/MqttDataProvider/MqttConnection.qc.dox.h