org.eclipse.paho.client.mqttv3.internal
Class Token
java.lang.Object
org.eclipse.paho.client.mqttv3.internal.Token
public class Token
- extends Object
message
protected MqttMessage message
messageID
public int messageID
notified
public boolean notified
Token
public Token(String logContext)
getMessageID
public int getMessageID()
setMessageID
public void setMessageID(int messageID)
checkResult
public boolean checkResult()
throws MqttException
- Throws:
MqttException
getException
public MqttException getException()
isComplete
public boolean isComplete()
isCompletePending
protected boolean isCompletePending()
isInUse
protected boolean isInUse()
setActionCallback
public void setActionCallback(IMqttActionListener listener)
getActionCallback
public IMqttActionListener getActionCallback()
waitForCompletion
public void waitForCompletion()
throws MqttException
- Throws:
MqttException
waitForCompletion
public void waitForCompletion(long timeout)
throws MqttException
- Throws:
MqttException
waitForResponse
protected MqttWireMessage waitForResponse()
throws MqttException
- Waits for the message delivery to complete, but doesn't throw an exception
in the case of a NACK. It does still throw an exception if something else
goes wrong (e.g. an IOException). This is used for packets like CONNECT,
which have useful information in the ACK that needs to be accessed.
- Throws:
MqttException
waitForResponse
protected MqttWireMessage waitForResponse(long timeout)
throws MqttException
- Throws:
MqttException
markComplete
protected void markComplete(MqttWireMessage msg,
MqttException ex)
- Mark the token as complete and ready for users to be notified.
- Parameters:
msg
- response message. Optional - there are no response messages for some flowsex
- if there was a problem store the exception in the token.
notifyComplete
protected void notifyComplete()
- Notifies this token that a response message (an ACK or NACK) has been
received.
waitUntilSent
public void waitUntilSent()
throws MqttException
- Throws:
MqttException
notifySent
protected void notifySent()
- Notifies this token that the associated message has been sent
(i.e. written to the TCP/IP socket).
getClient
public IMqttAsyncClient getClient()
setClient
protected void setClient(IMqttAsyncClient client)
reset
public void reset()
throws MqttException
- Throws:
MqttException
getMessage
public MqttMessage getMessage()
getWireMessage
public MqttWireMessage getWireMessage()
setMessage
public void setMessage(MqttMessage msg)
getTopics
public String[] getTopics()
setTopics
public void setTopics(String[] topics)
getUserContext
public Object getUserContext()
setUserContext
public void setUserContext(Object userContext)
setKey
public void setKey(String key)
getKey
public String getKey()
setException
public void setException(MqttException exception)
isNotified
public boolean isNotified()
setNotified
public void setNotified(boolean notified)
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2013. All Rights Reserved.