public class Token extends Object
Modifier and Type | Field and Description |
---|---|
protected MqttMessage |
message |
Modifier and Type | Method and Description |
---|---|
boolean |
checkResult() |
IMqttActionListener |
getActionCallback() |
IMqttAsyncClient |
getClient() |
MqttException |
getException() |
int[] |
getGrantedQos() |
String |
getKey() |
MqttMessage |
getMessage() |
int |
getMessageID() |
MqttWireMessage |
getResponse() |
boolean |
getSessionPresent() |
String[] |
getTopics() |
Object |
getUserContext() |
MqttWireMessage |
getWireMessage() |
boolean |
isComplete() |
protected boolean |
isCompletePending() |
protected boolean |
isInUse() |
boolean |
isNotified() |
protected void |
markComplete(MqttWireMessage msg,
MqttException ex)
Mark the token as complete and ready for users to be notified.
|
protected void |
notifyComplete()
Notifies this token that a response message (an ACK or NACK) has been
received.
|
protected void |
notifySent()
Notifies this token that the associated message has been sent
(i.e.
|
void |
reset() |
void |
setActionCallback(IMqttActionListener listener) |
protected void |
setClient(IMqttAsyncClient client) |
void |
setException(MqttException exception) |
void |
setKey(String key) |
void |
setMessage(MqttMessage msg) |
void |
setMessageID(int messageID) |
void |
setNotified(boolean notified) |
void |
setTopics(String[] topics) |
void |
setUserContext(Object userContext) |
String |
toString() |
void |
waitForCompletion() |
void |
waitForCompletion(long timeout) |
protected MqttWireMessage |
waitForResponse()
Waits for the message delivery to complete, but doesn't throw an exception
in the case of a NACK.
|
protected MqttWireMessage |
waitForResponse(long timeout) |
void |
waitUntilSent() |
protected MqttMessage message
public Token(String logContext)
public int getMessageID()
public void setMessageID(int messageID)
public boolean checkResult() throws MqttException
MqttException
public MqttException getException()
public boolean isComplete()
protected boolean isCompletePending()
protected boolean isInUse()
public void setActionCallback(IMqttActionListener listener)
public IMqttActionListener getActionCallback()
public void waitForCompletion() throws MqttException
MqttException
public void waitForCompletion(long timeout) throws MqttException
MqttException
protected MqttWireMessage waitForResponse() throws MqttException
MqttException
protected MqttWireMessage waitForResponse(long timeout) throws MqttException
MqttException
protected void markComplete(MqttWireMessage msg, MqttException ex)
msg
- response message. Optional - there are no response messages for some flowsex
- if there was a problem store the exception in the token.protected void notifyComplete()
public void waitUntilSent() throws MqttException
MqttException
protected void notifySent()
public IMqttAsyncClient getClient()
protected void setClient(IMqttAsyncClient client)
public void reset() throws MqttException
MqttException
public MqttMessage getMessage()
public MqttWireMessage getWireMessage()
public void setMessage(MqttMessage msg)
public String[] getTopics()
public void setTopics(String[] topics)
public Object getUserContext()
public void setUserContext(Object userContext)
public void setKey(String key)
public String getKey()
public void setException(MqttException exception)
public boolean isNotified()
public void setNotified(boolean notified)
public int[] getGrantedQos()
public boolean getSessionPresent()
public MqttWireMessage getResponse()
Copyright © 2019 Eclipse Paho. All rights reserved.