class documentation
class MQTTClient(object):
The general MQTT manager for this CSE.
| Method | config |
Callback for the configUpdate event. |
| Method | configure |
Configure the MQTT client. |
| Method | connect |
Connect to a oneM2M MQTT Broker. The connection is cached and reused. The key for identifying the broker is a tupple (address, port). A new MQTTClientHandler() object be used for handling requests. |
| Method | disconnect |
Remove the appropriate MQTTConnection for address and port from the connection cache and also shut-down the connection. |
| Method | get |
Return the MQTTConnection for the address and port from the internal connection cache. |
| Method | init |
Initialize the MQTT client. |
| Method | is |
Check whether the MQTT client is connected to a broker. Wait for a moment to take startup connection into account. |
| Method | is |
Check whether this mqttConnection is fully subscribed. |
| Method | pause |
Stop handling requests. |
| Method | run |
Initialize and run the MQTT client as a BackgroundWorker/Actor. |
| Method | send |
Sending a request via MQTT. |
| Method | shutdown |
Shutdown the MQTTClient. |
| Method | unpause |
Continue handling requests. |
| Method | validate |
Validate the MQTT client configuration. |
| Class Variable | __slots__ |
Slots for the MQTTClient. |
| Class Variable | request |
Injected RequestManager instance. |
| Instance Variable | is |
Flag to indicate whether the MQTT client is stopped. |
| Instance Variable | mqtt |
The MQTT connection. |
| Instance Variable | mqtt |
Dictionary of MQTT connections. |
Callback for the configUpdate event.
| Parameters | |
eventEventData | The event data, containing the name of the updated configuration setting and its new value. |
Configure the MQTT client.
| Parameters | |
config:Configuration | The configuration object to update with the MQTT client configuration. |
def connectToMqttBroker(self, address:
str, port: int, useTLS: bool, username: str | None, password: str | None) -> MQTTConnection | None:
¶
Connect to a oneM2M MQTT Broker. The connection is cached and reused. The key for identifying the broker is a tupple (address, port). A new MQTTClientHandler() object be used for handling requests.
Remove the appropriate MQTTConnection for address and port from the connection cache and also shut-down the connection.
Check whether the MQTT client is connected to a broker. Wait for a moment to take startup connection into account.
Validate the MQTT client configuration.
| Parameters | |
config:Configuration | The configuration object to validate. |