|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AsyncClientListener
Implement this interface to use the AsyncMqttClient
. The client will invoke the methods in this interface when various events happen. A single
instance of this interface may be used with multiple clients.
Field Summary | |
---|---|
static AsyncClientListener |
NULL_LISTENER
Use this listener when you want to ignore all client events including received messages. |
Method Summary | |
---|---|
void |
connected(MqttClient client,
ConnectReturnCode returnCode)
Called after the client has received a connect acknowledgment from the broker. |
void |
published(MqttClient client,
PublishMessage message)
Called when the protocol to send a client publish message to the broker is complete. |
void |
subscribed(MqttClient client,
Subscription[] requestedSubscriptions,
Subscription[] grantedSubscriptions,
boolean requestsGranted)
Called when the client receives a subscribe acknowledgment from the broker. |
void |
unsubscribed(MqttClient client,
String[] topics)
Called when an unsubscribe acknowledgment is received from the broker. |
Methods inherited from interface net.sf.xenqtt.client.MqttClientListener |
---|
disconnected, publishReceived |
Field Detail |
---|
static final AsyncClientListener NULL_LISTENER
listener
when you want to ignore all client events including received messages. Any received messages will be
ack'd
.
Method Detail |
---|
void connected(MqttClient client, ConnectReturnCode returnCode)
client
- The client that is connectedreturnCode
- The connect return code from the broker. Anything other than ConnectReturnCode.ACCEPTED
will result in the client being immediately
disconnected.void subscribed(MqttClient client, Subscription[] requestedSubscriptions, Subscription[] grantedSubscriptions, boolean requestsGranted)
client
- The client that requested the subscriptionsrequestedSubscriptions
- The subscriptions requested. The topics will be the same as those in grantedSubscriptions and the QoS
will be
the QoS the client requested.grantedSubscriptions
- The subscriptions. The topics will be the same as in requestedSubscriptions but the QoS
will be the QoS granted
by the broker, not the QoS requested by the client.requestsGranted
- True if the requested QoS
for each topic matches the granted QoS. False otherwise.void unsubscribed(MqttClient client, String[] topics)
client
- The client that requested the unsubscribetopics
- The topics unsubscribe from. These may include wildcards.void published(MqttClient client, PublishMessage message)
client
- The client the message was published tomessage
- The message that was published. This will be the same object passed to MqttClient.publish(PublishMessage)
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |