Package | Description |
---|---|
org.eclipse.paho.client.mqttv3 |
Contains a programming interface enabling applications to communicate with an MQTT server.
|
org.eclipse.paho.client.mqttv3.internal | |
org.eclipse.paho.client.mqttv3.internal.websocket | |
org.eclipse.paho.client.mqttv3.internal.wire |
Modifier and Type | Class and Description |
---|---|
class |
MqttPersistenceException
This exception is thrown by the implementor of the persistence
interface if there is a problem reading or writing persistent data.
|
class |
MqttSecurityException
Thrown when a client is not authorized to perform an operation, or
if there is a problem with the security configuration.
|
Modifier and Type | Method and Description |
---|---|
MqttException |
IMqttToken.getException()
Returns an exception providing more detail if an operation failed.
|
MqttException |
MqttToken.getException() |
Modifier and Type | Method and Description |
---|---|
IMqttToken |
MqttAsyncClient.checkPing(java.lang.Object userContext,
IMqttActionListener callback) |
void |
MqttClient.close() |
void |
IMqttClient.close()
Close the client
Releases all resource associated with the client.
|
void |
MqttAsyncClient.close() |
void |
IMqttAsyncClient.close()
Close the client
Releases all resource associated with the client.
|
void |
MqttClient.connect() |
void |
IMqttClient.connect()
Connects to an MQTT server using the default options.
|
IMqttToken |
MqttAsyncClient.connect() |
IMqttToken |
IMqttAsyncClient.connect()
Connects to an MQTT server using the default options.
|
void |
MqttClient.connect(MqttConnectOptions options) |
void |
IMqttClient.connect(MqttConnectOptions options)
Connects to an MQTT server using the specified options.
|
IMqttToken |
MqttAsyncClient.connect(MqttConnectOptions options) |
IMqttToken |
IMqttAsyncClient.connect(MqttConnectOptions options)
Connects to an MQTT server using the provided connect options.
|
IMqttToken |
MqttAsyncClient.connect(MqttConnectOptions options,
java.lang.Object userContext,
IMqttActionListener callback) |
IMqttToken |
IMqttAsyncClient.connect(MqttConnectOptions options,
java.lang.Object userContext,
IMqttActionListener callback)
Connects to an MQTT server using the specified options.
|
IMqttToken |
MqttAsyncClient.connect(java.lang.Object userContext,
IMqttActionListener callback) |
IMqttToken |
IMqttAsyncClient.connect(java.lang.Object userContext,
IMqttActionListener callback)
Connects to an MQTT server using the default options.
|
IMqttToken |
MqttClient.connectWithResult(MqttConnectOptions options) |
IMqttToken |
IMqttClient.connectWithResult(MqttConnectOptions options)
Connects to an MQTT server using the specified options.
|
void |
MqttClient.disconnect() |
void |
IMqttClient.disconnect()
Disconnects from the server.
|
IMqttToken |
MqttAsyncClient.disconnect() |
IMqttToken |
IMqttAsyncClient.disconnect()
Disconnects from the server.
|
void |
MqttClient.disconnect(long quiesceTimeout) |
void |
IMqttClient.disconnect(long quiesceTimeout)
Disconnects from the server.
|
IMqttToken |
MqttAsyncClient.disconnect(long quiesceTimeout) |
IMqttToken |
IMqttAsyncClient.disconnect(long quiesceTimeout)
Disconnects from the server.
|
IMqttToken |
MqttAsyncClient.disconnect(long quiesceTimeout,
java.lang.Object userContext,
IMqttActionListener callback) |
IMqttToken |
IMqttAsyncClient.disconnect(long quiesceTimeout,
java.lang.Object userContext,
IMqttActionListener callback)
Disconnects from the server.
|
IMqttToken |
MqttAsyncClient.disconnect(java.lang.Object userContext,
IMqttActionListener callback) |
IMqttToken |
IMqttAsyncClient.disconnect(java.lang.Object userContext,
IMqttActionListener callback)
Disconnects from the server.
|
void |
MqttClient.disconnectForcibly() |
void |
IMqttClient.disconnectForcibly()
Disconnects from the server forcibly to reset all the states.
|
void |
MqttAsyncClient.disconnectForcibly() |
void |
IMqttAsyncClient.disconnectForcibly()
Disconnects from the server forcibly to reset all the states.
|
void |
MqttClient.disconnectForcibly(long disconnectTimeout) |
void |
IMqttClient.disconnectForcibly(long disconnectTimeout)
Disconnects from the server forcibly to reset all the states.
|
void |
MqttAsyncClient.disconnectForcibly(long disconnectTimeout) |
void |
IMqttAsyncClient.disconnectForcibly(long disconnectTimeout)
Disconnects from the server forcibly to reset all the states.
|
void |
MqttClient.disconnectForcibly(long quiesceTimeout,
long disconnectTimeout) |
void |
IMqttClient.disconnectForcibly(long quiesceTimeout,
long disconnectTimeout)
Disconnects from the server forcibly to reset all the states.
|
void |
MqttAsyncClient.disconnectForcibly(long quiesceTimeout,
long disconnectTimeout) |
void |
IMqttAsyncClient.disconnectForcibly(long quiesceTimeout,
long disconnectTimeout)
Disconnects from the server forcibly to reset all the states.
|
MqttMessage |
MqttDeliveryToken.getMessage()
Returns the message associated with this token.
|
MqttMessage |
IMqttDeliveryToken.getMessage()
Returns the message associated with this token.
|
void |
MqttClient.messageArrivedComplete(int messageId,
int qos) |
void |
IMqttClient.messageArrivedComplete(int messageId,
int qos)
Indicate that the application has completed processing the message with id messageId.
|
void |
MqttAsyncClient.messageArrivedComplete(int messageId,
int qos) |
void |
IMqttAsyncClient.messageArrivedComplete(int messageId,
int qos)
Indicate that the application has completed processing the message with id messageId.
|
MqttDeliveryToken |
MqttTopic.publish(byte[] payload,
int qos,
boolean retained)
Publishes a message on the topic.
|
MqttDeliveryToken |
MqttTopic.publish(MqttMessage message)
Publishes the specified message to this topic, but does not wait for delivery
of the message to complete.
|
void |
MqttClient.publish(java.lang.String topic,
byte[] payload,
int qos,
boolean retained) |
void |
IMqttClient.publish(java.lang.String topic,
byte[] payload,
int qos,
boolean retained)
Publishes a message to a topic on the server and return once it is delivered.
|
IMqttDeliveryToken |
MqttAsyncClient.publish(java.lang.String topic,
byte[] payload,
int qos,
boolean retained) |
IMqttDeliveryToken |
IMqttAsyncClient.publish(java.lang.String topic,
byte[] payload,
int qos,
boolean retained)
Publishes a message to a topic on the server.
|
IMqttDeliveryToken |
MqttAsyncClient.publish(java.lang.String topic,
byte[] payload,
int qos,
boolean retained,
java.lang.Object userContext,
IMqttActionListener callback) |
IMqttDeliveryToken |
IMqttAsyncClient.publish(java.lang.String topic,
byte[] payload,
int qos,
boolean retained,
java.lang.Object userContext,
IMqttActionListener callback)
Publishes a message to a topic on the server.
|
void |
MqttClient.publish(java.lang.String topic,
MqttMessage message) |
void |
IMqttClient.publish(java.lang.String topic,
MqttMessage message)
Publishes a message to a topic on the server.
|
IMqttDeliveryToken |
MqttAsyncClient.publish(java.lang.String topic,
MqttMessage message) |
IMqttDeliveryToken |
IMqttAsyncClient.publish(java.lang.String topic,
MqttMessage message)
Publishes a message to a topic on the server.
|
IMqttDeliveryToken |
MqttAsyncClient.publish(java.lang.String topic,
MqttMessage message,
java.lang.Object userContext,
IMqttActionListener callback) |
IMqttDeliveryToken |
IMqttAsyncClient.publish(java.lang.String topic,
MqttMessage message,
java.lang.Object userContext,
IMqttActionListener callback)
Publishes a message to a topic on the server.
|
void |
MqttClient.reconnect() |
void |
MqttAsyncClient.reconnect()
User triggered attempt to reconnect
|
void |
MqttClient.subscribe(java.lang.String topicFilter) |
void |
IMqttClient.subscribe(java.lang.String topicFilter)
Subscribe to a topic, which may include wildcards using a QoS of 1.
|
void |
MqttClient.subscribe(java.lang.String[] topicFilters) |
void |
IMqttClient.subscribe(java.lang.String[] topicFilters)
Subscribes to a one or more topics, which may include wildcards using a QoS of 1.
|
void |
MqttClient.subscribe(java.lang.String[] topicFilters,
IMqttMessageListener[] messageListeners) |
void |
IMqttClient.subscribe(java.lang.String[] topicFilters,
IMqttMessageListener[] messageListeners)
Subscribes to a one or more topics, which may include wildcards using a QoS of 1.
|
void |
MqttClient.subscribe(java.lang.String[] topicFilters,
int[] qos) |
void |
IMqttClient.subscribe(java.lang.String[] topicFilters,
int[] qos)
Subscribes to multiple topics, each of which may include wildcards.
|
IMqttToken |
MqttAsyncClient.subscribe(java.lang.String[] topicFilters,
int[] qos) |
IMqttToken |
IMqttAsyncClient.subscribe(java.lang.String[] topicFilters,
int[] qos)
Subscribe to multiple topics, each of which may include wildcards.
|
void |
MqttClient.subscribe(java.lang.String[] topicFilters,
int[] qos,
IMqttMessageListener[] messageListeners) |
void |
IMqttClient.subscribe(java.lang.String[] topicFilters,
int[] qos,
IMqttMessageListener[] messageListeners)
Subscribes to multiple topics, each of which may include wildcards.
|
IMqttToken |
MqttAsyncClient.subscribe(java.lang.String[] topicFilters,
int[] qos,
IMqttMessageListener[] messageListeners) |
IMqttToken |
IMqttAsyncClient.subscribe(java.lang.String[] topicFilters,
int[] qos,
IMqttMessageListener[] messageListeners)
Subscribe to multiple topics, each of which may include wildcards.
|
IMqttToken |
MqttAsyncClient.subscribe(java.lang.String[] topicFilters,
int[] qos,
java.lang.Object userContext,
IMqttActionListener callback) |
IMqttToken |
IMqttAsyncClient.subscribe(java.lang.String[] topicFilters,
int[] qos,
java.lang.Object userContext,
IMqttActionListener callback)
Subscribes to multiple topics, each of which may include wildcards.
|
IMqttToken |
MqttAsyncClient.subscribe(java.lang.String[] topicFilters,
int[] qos,
java.lang.Object userContext,
IMqttActionListener callback,
IMqttMessageListener[] messageListeners) |
IMqttToken |
IMqttAsyncClient.subscribe(java.lang.String[] topicFilters,
int[] qos,
java.lang.Object userContext,
IMqttActionListener callback,
IMqttMessageListener[] messageListeners)
Subscribe to multiple topics, each of which may include wildcards.
|
void |
MqttClient.subscribe(java.lang.String topicFilter,
IMqttMessageListener messageListener) |
void |
IMqttClient.subscribe(java.lang.String topicFilter,
IMqttMessageListener messageListener)
Subscribe to a topic, which may include wildcards using a QoS of 1.
|
void |
MqttClient.subscribe(java.lang.String topicFilter,
int qos) |
void |
IMqttClient.subscribe(java.lang.String topicFilter,
int qos)
Subscribe to a topic, which may include wildcards.
|
IMqttToken |
MqttAsyncClient.subscribe(java.lang.String topicFilter,
int qos) |
IMqttToken |
IMqttAsyncClient.subscribe(java.lang.String topicFilter,
int qos)
Subscribe to a topic, which may include wildcards.
|
void |
MqttClient.subscribe(java.lang.String topicFilter,
int qos,
IMqttMessageListener messageListener) |
void |
IMqttClient.subscribe(java.lang.String topicFilter,
int qos,
IMqttMessageListener messageListener)
Subscribe to a topic, which may include wildcards.
|
IMqttToken |
MqttAsyncClient.subscribe(java.lang.String topicFilter,
int qos,
IMqttMessageListener messageListener) |
IMqttToken |
IMqttAsyncClient.subscribe(java.lang.String topicFilter,
int qos,
IMqttMessageListener messageListener)
Subscribe to a topic, which may include wildcards.
|
IMqttToken |
MqttAsyncClient.subscribe(java.lang.String topicFilter,
int qos,
java.lang.Object userContext,
IMqttActionListener callback) |
IMqttToken |
IMqttAsyncClient.subscribe(java.lang.String topicFilter,
int qos,
java.lang.Object userContext,
IMqttActionListener callback)
Subscribe to a topic, which may include wildcards.
|
IMqttToken |
MqttAsyncClient.subscribe(java.lang.String topicFilter,
int qos,
java.lang.Object userContext,
IMqttActionListener callback,
IMqttMessageListener messageListener) |
IMqttToken |
IMqttAsyncClient.subscribe(java.lang.String topicFilter,
int qos,
java.lang.Object userContext,
IMqttActionListener callback,
IMqttMessageListener messageListener)
Subscribe to a topic, which may include wildcards.
|
void |
MqttClient.unsubscribe(java.lang.String topicFilter) |
void |
IMqttClient.unsubscribe(java.lang.String topicFilter)
Requests the server unsubscribe the client from a topic.
|
IMqttToken |
MqttAsyncClient.unsubscribe(java.lang.String topicFilter) |
IMqttToken |
IMqttAsyncClient.unsubscribe(java.lang.String topicFilter)
Requests the server unsubscribe the client from a topic.
|
void |
MqttClient.unsubscribe(java.lang.String[] topicFilters) |
void |
IMqttClient.unsubscribe(java.lang.String[] topicFilters)
Requests the server unsubscribe the client from one or more topics.
|
IMqttToken |
MqttAsyncClient.unsubscribe(java.lang.String[] topicFilters) |
IMqttToken |
IMqttAsyncClient.unsubscribe(java.lang.String[] topicFilters)
Requests the server unsubscribe the client from one or more topics.
|
IMqttToken |
MqttAsyncClient.unsubscribe(java.lang.String[] topicFilters,
java.lang.Object userContext,
IMqttActionListener callback) |
IMqttToken |
IMqttAsyncClient.unsubscribe(java.lang.String[] topicFilters,
java.lang.Object userContext,
IMqttActionListener callback)
Requests the server unsubscribe the client from one or more topics.
|
IMqttToken |
MqttAsyncClient.unsubscribe(java.lang.String topicFilter,
java.lang.Object userContext,
IMqttActionListener callback) |
IMqttToken |
IMqttAsyncClient.unsubscribe(java.lang.String topicFilter,
java.lang.Object userContext,
IMqttActionListener callback)
Requests the server unsubscribe the client from a topics.
|
void |
IMqttToken.waitForCompletion()
Blocks the current thread until the action this token is associated with has
completed.
|
void |
MqttToken.waitForCompletion() |
void |
IMqttToken.waitForCompletion(long timeout)
Blocks the current thread until the action this token is associated with has
completed.
|
void |
MqttToken.waitForCompletion(long timeout) |
Constructor and Description |
---|
MqttAsyncClient(java.lang.String serverURI,
java.lang.String clientId)
Create an MqttAsyncClient that is used to communicate with an MQTT server.
|
MqttAsyncClient(java.lang.String serverURI,
java.lang.String clientId,
MqttClientPersistence persistence) |
MqttAsyncClient(java.lang.String serverURI,
java.lang.String clientId,
MqttClientPersistence persistence,
MqttPingSender pingSender)
Create an MqttAsyncClient that is used to communicate with an MQTT server.
|
MqttClient(java.lang.String serverURI,
java.lang.String clientId)
Create an MqttClient that can be used to communicate with an MQTT server.
|
MqttClient(java.lang.String serverURI,
java.lang.String clientId,
MqttClientPersistence persistence)
Create an MqttClient that can be used to communicate with an MQTT server.
|
Modifier and Type | Method and Description |
---|---|
static MqttException |
ExceptionHelper.createMqttException(int reasonCode) |
static MqttException |
ExceptionHelper.createMqttException(java.lang.Throwable cause) |
MqttException |
Token.getException() |
Modifier and Type | Method and Description |
---|---|
void |
ClientComms.connectComplete(MqttConnack cack,
MqttException mex) |
void |
CommsCallback.connectionLost(MqttException cause)
This method is called when the connection to the server is lost.
|
void |
ClientState.disconnected(MqttException reason)
Called when the client has been disconnected from the broker.
|
java.util.Vector |
ClientState.resolveOldTokens(MqttException reason)
Called during shutdown to work out if there are any tokens still
to be notified and waiters to be unblocked.
|
void |
Token.setException(MqttException exception) |
void |
ClientComms.shutdownConnection(MqttToken token,
MqttException reason)
Shuts down the connection to the server.
|
Modifier and Type | Method and Description |
---|---|
MqttToken |
ClientState.checkForActivity(IMqttActionListener pingCallback)
Check and send a ping if needed and check for ping timeout.
|
boolean |
Token.checkResult() |
void |
ClientComms.close()
Close and tidy up.
|
void |
ClientComms.connect(MqttConnectOptions options,
MqttToken token)
Sends a connect message and waits for an ACK or NACK.
|
void |
ClientComms.connectComplete(MqttConnack cack,
MqttException mex) |
void |
ClientComms.disconnect(MqttDisconnect disconnect,
long quiesceTimeout,
MqttToken token) |
void |
ClientComms.disconnectForcibly(long quiesceTimeout,
long disconnectTimeout)
Disconnect the connection and reset all the states.
|
void |
ClientComms.messageArrivedComplete(int messageId,
int qos) |
void |
CommsCallback.messageArrivedComplete(int messageId,
int qos) |
void |
IDisconnectedBufferCallback.publishBufferedMessage(BufferedMessage bufferedMessage) |
void |
DisconnectedMessageBuffer.putMessage(MqttWireMessage message,
MqttToken token)
This will add a new message to the offline buffer,
if the buffer is full and deleteOldestMessages is enabled
then the 0th item in the buffer will be deleted and the
new message will be added.
|
void |
Token.reset() |
void |
ClientState.send(MqttWireMessage message,
MqttToken token)
Submits a message for delivery.
|
void |
ClientComms.sendNoWait(MqttWireMessage message,
MqttToken token)
Sends a message to the broker if in connected state, but only waits for the message to be
stored, before returning.
|
void |
NetworkModule.start() |
void |
SSLNetworkModule.start() |
void |
LocalNetworkModule.start() |
void |
TCPNetworkModule.start()
Starts the module, by creating a TCP socket to the server.
|
void |
Token.waitForCompletion() |
void |
Token.waitForCompletion(long timeout) |
void |
Token.waitUntilSent() |
Constructor and Description |
---|
ClientComms(IMqttAsyncClient client,
MqttClientPersistence persistence,
MqttPingSender pingSender)
Creates a new ClientComms object, using the specified module to handle
the network calls.
|
Modifier and Type | Method and Description |
---|---|
void |
WebSocketSecureNetworkModule.start() |
void |
WebSocketNetworkModule.start() |
Modifier and Type | Method and Description |
---|---|
static MqttWireMessage |
MqttWireMessage.createWireMessage(byte[] bytes) |
static MqttWireMessage |
MqttWireMessage.createWireMessage(MqttPersistable data) |
byte[] |
MqttWireMessage.getHeader() |
byte[] |
MqttWireMessage.getPayload()
Sub-classes should override this method to supply the payload bytes.
|
byte[] |
MqttUnsubscribe.getPayload() |
byte[] |
MqttSubscribe.getPayload() |
byte[] |
MqttPublish.getPayload() |
byte[] |
MqttConnect.getPayload() |
MqttWireMessage |
MqttInputStream.readMqttWireMessage()
Reads an
MqttWireMessage from the stream. |
void |
MqttOutputStream.write(MqttWireMessage message)
Writes an
MqttWireMessage to the stream. |
Constructor and Description |
---|
MqttConnect(byte info,
byte[] data)
Constructor for an on the wire MQTT connect message
|
MqttPublish(byte info,
byte[] data)
Constructs a new MqttPublish object.
|