Package de.poiu.coat.example.mqtt
Class DummyMqttClient
java.lang.Object
de.poiu.coat.example.mqtt.DummyMqttClient
A dummy MQTT client for demonstration purposes. It only provides a minimal API and no actual functionality.
-
Constructor Summary
ConstructorsConstructorDescriptionDummyMqttClient(InetAddress[] brokerAddresses, int port) Create a new DummyMqttClient that connects to the specified address(es) and port. -
Method Summary
Modifier and TypeMethodDescriptionvoidconnect()Connect to the MQTT broker.voidsetClientId(String clientId) Set a custom client ID for connecting to the MQTT broker.voidsetPassword(String password) Set the password to connect to the MQTT broker.voidsetUsername(String username) Set the username to connect to the MQTT broker.
-
Constructor Details
-
DummyMqttClient
Create a new DummyMqttClient that connects to the specified address(es) and port. The given addresses must include at least one address, but can have several fallback addresses. They will be tried sequentially.
-
-
Method Details
-
setClientId
Set a custom client ID for connecting to the MQTT broker. -
setUsername
Set the username to connect to the MQTT broker. -
setPassword
Set the password to connect to the MQTT broker. -
connect
public void connect()Connect to the MQTT broker. This will try to connect to each fallback broker in succession until a connection could be established.
-