public class Token
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected MqttMessage |
message |
Constructor and Description |
---|
Token(java.lang.String logContext) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkResult() |
IMqttActionListener |
getActionCallback() |
IMqttAsyncClient |
getClient() |
MqttException |
getException() |
int[] |
getGrantedQos() |
java.lang.String |
getKey() |
MqttMessage |
getMessage() |
int |
getMessageID() |
MqttWireMessage |
getResponse() |
boolean |
getSessionPresent() |
java.lang.String[] |
getTopics() |
java.lang.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(java.lang.String key) |
void |
setMessage(MqttMessage msg) |
void |
setMessageID(int messageID) |
void |
setNotified(boolean notified) |
void |
setTopics(java.lang.String[] topics) |
void |
setUserContext(java.lang.Object userContext) |
java.lang.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() |
@Nullable protected MqttMessage message
public int getMessageID()
public void setMessageID(int messageID)
public boolean checkResult() throws MqttException
MqttException
@Nullable public MqttException getException()
public boolean isComplete()
protected boolean isCompletePending()
protected boolean isInUse()
public void setActionCallback(IMqttActionListener listener)
@Nullable public IMqttActionListener getActionCallback()
public void waitForCompletion() throws MqttException
MqttException
public void waitForCompletion(long timeout) throws MqttException
MqttException
@Nullable protected MqttWireMessage waitForResponse() throws MqttException
MqttException
@Nullable protected MqttWireMessage waitForResponse(long timeout) throws MqttException
MqttException
protected void markComplete(@Nullable MqttWireMessage msg, @Nullable 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()
@Nullable public IMqttAsyncClient getClient()
protected void setClient(IMqttAsyncClient client)
public void reset() throws MqttException
MqttException
@Nullable public MqttMessage getMessage()
@Nullable public MqttWireMessage getWireMessage()
public void setMessage(MqttMessage msg)
@Nullable public java.lang.String[] getTopics()
public void setTopics(java.lang.String[] topics)
@Nullable public java.lang.Object getUserContext()
public void setUserContext(java.lang.Object userContext)
public void setKey(java.lang.String key)
@Nullable public java.lang.String getKey()
public void setException(@Nullable MqttException exception)
public boolean isNotified()
public void setNotified(boolean notified)
public java.lang.String toString()
toString
in class java.lang.Object
public int[] getGrantedQos()
public boolean getSessionPresent()
@Nullable public MqttWireMessage getResponse()