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.wire | |
org.eclipse.paho.sample.utility |
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 |
MqttToken.getException() |
MqttException |
IMqttToken.getException()
Returns an exception providing more detail if an operation failed.
|
Modifier and Type | Method and Description |
---|---|
IMqttToken |
MqttAsyncClient.checkPing(Object userContext,
IMqttActionListener callback) |
void |
IMqttAsyncClient.close()
Close the client
Releases all resource associated with the client.
|
void |
MqttAsyncClient.close() |
void |
MqttClient.close() |
void |
IMqttClient.close()
Close the client
Releases all resource associated with the client.
|
IMqttToken |
IMqttAsyncClient.connect()
Connects to an MQTT server using the default options.
|
IMqttToken |
MqttAsyncClient.connect() |
void |
MqttClient.connect() |
void |
IMqttClient.connect()
Connects to an MQTT server using the default options.
|
IMqttToken |
IMqttAsyncClient.connect(MqttConnectOptions options)
Connects to an MQTT server using the provided connect options.
|
IMqttToken |
MqttAsyncClient.connect(MqttConnectOptions options) |
void |
MqttClient.connect(MqttConnectOptions options) |
void |
IMqttClient.connect(MqttConnectOptions options)
Connects to an MQTT server using the specified options.
|
IMqttToken |
IMqttAsyncClient.connect(MqttConnectOptions options,
Object userContext,
IMqttActionListener callback)
Connects to an MQTT server using the specified options.
|
IMqttToken |
MqttAsyncClient.connect(MqttConnectOptions options,
Object userContext,
IMqttActionListener callback) |
IMqttToken |
IMqttAsyncClient.connect(Object userContext,
IMqttActionListener callback)
Connects to an MQTT server using the default options.
|
IMqttToken |
MqttAsyncClient.connect(Object userContext,
IMqttActionListener callback) |
IMqttToken |
MqttClient.connectWithResult(MqttConnectOptions options) |
IMqttToken |
IMqttClient.connectWithResult(MqttConnectOptions options)
Connects to an MQTT server using the specified options.
|
protected NetworkModule[] |
MqttAsyncClient.createNetworkModules(String address,
MqttConnectOptions options)
Factory method to create an array of network modules, one for
each of the supplied URIs
|
IMqttToken |
IMqttAsyncClient.disconnect()
Disconnects from the server.
|
IMqttToken |
MqttAsyncClient.disconnect() |
void |
MqttClient.disconnect() |
void |
IMqttClient.disconnect()
Disconnects from the server.
|
IMqttToken |
IMqttAsyncClient.disconnect(long quiesceTimeout)
Disconnects from the server.
|
IMqttToken |
MqttAsyncClient.disconnect(long quiesceTimeout) |
void |
MqttClient.disconnect(long quiesceTimeout) |
void |
IMqttClient.disconnect(long quiesceTimeout)
Disconnects from the server.
|
IMqttToken |
IMqttAsyncClient.disconnect(long quiesceTimeout,
Object userContext,
IMqttActionListener callback)
Disconnects from the server.
|
IMqttToken |
MqttAsyncClient.disconnect(long quiesceTimeout,
Object userContext,
IMqttActionListener callback) |
IMqttToken |
IMqttAsyncClient.disconnect(Object userContext,
IMqttActionListener callback)
Disconnects from the server.
|
IMqttToken |
MqttAsyncClient.disconnect(Object userContext,
IMqttActionListener callback) |
void |
IMqttAsyncClient.disconnectForcibly()
Disconnects from the server forcibly to reset all the states.
|
void |
MqttAsyncClient.disconnectForcibly() |
void |
MqttClient.disconnectForcibly() |
void |
IMqttClient.disconnectForcibly()
Disconnects from the server forcibly to reset all the states.
|
void |
IMqttAsyncClient.disconnectForcibly(long disconnectTimeout)
Disconnects from the server forcibly to reset all the states.
|
void |
MqttAsyncClient.disconnectForcibly(long disconnectTimeout) |
void |
MqttClient.disconnectForcibly(long disconnectTimeout) |
void |
IMqttClient.disconnectForcibly(long disconnectTimeout)
Disconnects from the server forcibly to reset all the states.
|
void |
IMqttAsyncClient.disconnectForcibly(long quiesceTimeout,
long disconnectTimeout)
Disconnects from the server forcibly to reset all the states.
|
void |
MqttAsyncClient.disconnectForcibly(long quiesceTimeout,
long disconnectTimeout) |
void |
MqttClient.disconnectForcibly(long quiesceTimeout,
long disconnectTimeout) |
void |
IMqttClient.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.
|
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.
|
IMqttDeliveryToken |
IMqttAsyncClient.publish(String topic,
byte[] payload,
int qos,
boolean retained)
Publishes a message to a topic on the server.
|
IMqttDeliveryToken |
MqttAsyncClient.publish(String topic,
byte[] payload,
int qos,
boolean retained) |
void |
MqttClient.publish(String topic,
byte[] payload,
int qos,
boolean retained) |
void |
IMqttClient.publish(String topic,
byte[] payload,
int qos,
boolean retained)
Publishes a message to a topic on the server and return once it is delivered.
|
IMqttDeliveryToken |
IMqttAsyncClient.publish(String topic,
byte[] payload,
int qos,
boolean retained,
Object userContext,
IMqttActionListener callback)
Publishes a message to a topic on the server.
|
IMqttDeliveryToken |
MqttAsyncClient.publish(String topic,
byte[] payload,
int qos,
boolean retained,
Object userContext,
IMqttActionListener callback) |
IMqttDeliveryToken |
IMqttAsyncClient.publish(String topic,
MqttMessage message)
Publishes a message to a topic on the server.
|
IMqttDeliveryToken |
MqttAsyncClient.publish(String topic,
MqttMessage message) |
void |
MqttClient.publish(String topic,
MqttMessage message) |
void |
IMqttClient.publish(String topic,
MqttMessage message)
Publishes a message to a topic on the server.
|
IMqttDeliveryToken |
IMqttAsyncClient.publish(String topic,
MqttMessage message,
Object userContext,
IMqttActionListener callback)
Publishes a message to a topic on the server.
|
IMqttDeliveryToken |
MqttAsyncClient.publish(String topic,
MqttMessage message,
Object userContext,
IMqttActionListener callback) |
void |
MqttClient.subscribe(String topicFilter) |
void |
IMqttClient.subscribe(String topicFilter)
Subscribe to a topic, which may include wildcards using a QoS of 1.
|
void |
MqttClient.subscribe(String[] topicFilters) |
void |
IMqttClient.subscribe(String[] topicFilters)
Subscribes to a one or more topics, which may include wildcards using a QoS of 1.
|
IMqttToken |
IMqttAsyncClient.subscribe(String[] topicFilters,
int[] qos)
Subscribe to multiple topics, each of which may include wildcards.
|
IMqttToken |
MqttAsyncClient.subscribe(String[] topicFilters,
int[] qos) |
void |
MqttClient.subscribe(String[] topicFilters,
int[] qos) |
void |
IMqttClient.subscribe(String[] topicFilters,
int[] qos)
Subscribes to multiple topics, each of which may include wildcards.
|
IMqttToken |
IMqttAsyncClient.subscribe(String[] topicFilters,
int[] qos,
Object userContext,
IMqttActionListener callback)
Subscribes to multiple topics, each of which may include wildcards.
|
IMqttToken |
MqttAsyncClient.subscribe(String[] topicFilters,
int[] qos,
Object userContext,
IMqttActionListener callback) |
IMqttToken |
IMqttAsyncClient.subscribe(String topicFilter,
int qos)
Subscribe to a topic, which may include wildcards.
|
IMqttToken |
MqttAsyncClient.subscribe(String topicFilter,
int qos) |
void |
MqttClient.subscribe(String topicFilter,
int qos) |
void |
IMqttClient.subscribe(String topicFilter,
int qos)
Subscribe to a topic, which may include wildcards.
|
IMqttToken |
IMqttAsyncClient.subscribe(String topicFilter,
int qos,
Object userContext,
IMqttActionListener callback)
Subscribe to a topic, which may include wildcards.
|
IMqttToken |
MqttAsyncClient.subscribe(String topicFilter,
int qos,
Object userContext,
IMqttActionListener callback) |
IMqttToken |
IMqttAsyncClient.unsubscribe(String topicFilter)
Requests the server unsubscribe the client from a topic.
|
IMqttToken |
MqttAsyncClient.unsubscribe(String topicFilter) |
void |
MqttClient.unsubscribe(String topicFilter) |
void |
IMqttClient.unsubscribe(String topicFilter)
Requests the server unsubscribe the client from a topic.
|
IMqttToken |
IMqttAsyncClient.unsubscribe(String[] topicFilters)
Requests the server unsubscribe the client from one or more topics.
|
IMqttToken |
MqttAsyncClient.unsubscribe(String[] topicFilters) |
void |
MqttClient.unsubscribe(String[] topicFilters) |
void |
IMqttClient.unsubscribe(String[] topicFilters)
Requests the server unsubscribe the client from one or more topics.
|
IMqttToken |
IMqttAsyncClient.unsubscribe(String[] topicFilters,
Object userContext,
IMqttActionListener callback)
Requests the server unsubscribe the client from one or more topics.
|
IMqttToken |
MqttAsyncClient.unsubscribe(String[] topicFilters,
Object userContext,
IMqttActionListener callback) |
IMqttToken |
IMqttAsyncClient.unsubscribe(String topicFilter,
Object userContext,
IMqttActionListener callback)
Requests the server unsubscribe the client from a topics.
|
IMqttToken |
MqttAsyncClient.unsubscribe(String topicFilter,
Object userContext,
IMqttActionListener callback) |
void |
MqttToken.waitForCompletion() |
void |
IMqttToken.waitForCompletion()
Blocks the current thread until the action this token is associated with has
completed.
|
void |
MqttToken.waitForCompletion(long timeout) |
void |
IMqttToken.waitForCompletion(long timeout)
Blocks the current thread until the action this token is associated with has
completed.
|
Constructor and Description |
---|
MqttAsyncClient(String serverURI,
String clientId)
Create an MqttAsyncClient that is used to communicate with an MQTT server.
|
MqttAsyncClient(String serverURI,
String clientId,
MqttClientPersistence persistence) |
MqttAsyncClient(String serverURI,
String clientId,
MqttClientPersistence persistence,
MqttPingSender pingSender)
Create an MqttAsyncClient that is used to communicate with an MQTT server.
|
MqttClient(String serverURI,
String clientId)
Create an MqttClient that can be used to communicate with an MQTT server.
|
MqttClient(String serverURI,
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(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.
|
protected void |
Token.markComplete(MqttWireMessage msg,
MqttException ex)
Mark the token as complete and ready for users to be notified.
|
protected void |
ClientState.notifyResult(MqttWireMessage ack,
MqttToken token,
MqttException ex) |
protected void |
CommsTokenStore.quiesce(MqttException quiesceResponse) |
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()
Check and send a ping if needed and check for ping timeout.
|
boolean |
Token.checkResult() |
protected void |
ClientState.clearState() |
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.
|
protected MqttWireMessage |
ClientState.get()
This returns the next piece of work, ie message, for the CommsSender
to send over the network.
|
protected void |
ClientState.notifyComplete(MqttToken token)
Called when waiters and callbacks have processed the message.
|
protected void |
ClientState.notifyReceivedAck(MqttAck ack)
Called by the CommsReceiver when an ack has arrived.
|
protected void |
ClientState.notifyReceivedMsg(MqttWireMessage message)
Called by the CommsReceiver when a message has been received.
|
void |
Token.reset() |
protected void |
ClientState.restoreState()
Restores the state information from persistence.
|
protected void |
CommsTokenStore.saveToken(MqttToken token,
MqttWireMessage message) |
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 |
LocalNetworkModule.start() |
void |
TCPNetworkModule.start()
Starts the module, by creating a TCP socket to the server.
|
void |
SSLNetworkModule.start() |
void |
NetworkModule.start() |
void |
Token.waitForCompletion() |
void |
Token.waitForCompletion(long timeout) |
protected MqttWireMessage |
Token.waitForResponse()
Waits for the message delivery to complete, but doesn't throw an exception
in the case of a NACK.
|
protected MqttWireMessage |
Token.waitForResponse(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.
|
ClientState(MqttClientPersistence persistence,
CommsTokenStore tokenStore,
CommsCallback callback,
ClientComms clientComms,
MqttPingSender pingSender) |
Modifier and Type | Method and Description |
---|---|
static MqttWireMessage |
MqttWireMessage.createWireMessage(byte[] bytes) |
static MqttWireMessage |
MqttWireMessage.createWireMessage(MqttPersistable data) |
protected String |
MqttWireMessage.decodeUTF8(DataInputStream input)
Decodes a UTF-8 string from the DataInputStream provided.
|
protected byte[] |
MqttWireMessage.encodeMessageId() |
protected void |
MqttWireMessage.encodeUTF8(DataOutputStream dos,
String stringToEncode)
Encodes a String given into UTF-8, before writing this to the DataOutputStream the length of the
encoded string is encoded into two bytes and then written to the DataOutputStream.
|
byte[] |
MqttWireMessage.getHeader() |
byte[] |
MqttUnsubscribe.getPayload() |
byte[] |
MqttSubscribe.getPayload() |
byte[] |
MqttWireMessage.getPayload()
Sub-classes should override this method to supply the payload bytes.
|
byte[] |
MqttPublish.getPayload() |
byte[] |
MqttConnect.getPayload() |
protected byte[] |
MqttUnsubscribe.getVariableHeader() |
protected byte[] |
MqttPingResp.getVariableHeader() |
protected byte[] |
MqttSubscribe.getVariableHeader() |
protected byte[] |
MqttPingReq.getVariableHeader() |
protected byte[] |
MqttUnsubAck.getVariableHeader() |
protected abstract byte[] |
MqttWireMessage.getVariableHeader() |
protected byte[] |
MqttSuback.getVariableHeader() |
protected byte[] |
MqttDisconnect.getVariableHeader() |
protected byte[] |
MqttPublish.getVariableHeader() |
protected byte[] |
MqttPubComp.getVariableHeader() |
protected byte[] |
MqttPubRec.getVariableHeader() |
protected byte[] |
MqttPubRel.getVariableHeader() |
protected byte[] |
MqttPubAck.getVariableHeader() |
protected byte[] |
MqttConnack.getVariableHeader() |
protected byte[] |
MqttConnect.getVariableHeader() |
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.
|
Modifier and Type | Method and Description |
---|---|
void |
MQTTFrame.connect(String connStr,
boolean usePersistence)
A wrapper for the MQTT connect method.
|
void |
MQTTFrame.startTrace()
This method calls the MQTT startTrace method to produce trace of the protocol flows
|
Copyright © 2017 Eclipse Paho. All rights reserved.