public class CommsTokenStore
extends java.lang.Object
saveToken(MqttToken, MqttWireMessage)
method.
Anyone interested in tacking the state can call one of the wait methods on the token or using the asynchronous
listener callback method on the operation. The CommsReceiver
class, on another thread, reads responses back
from the network. It uses the response to find the relevant token, which it can then notify.
Note: Ping, connect and disconnect do not have a unique message id as only one outstanding request of each type is
allowed to be outstandingConstructor and Description |
---|
CommsTokenStore(java.lang.String logContext) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Empties the token store without notifying any of the tokens.
|
int |
count() |
MqttDeliveryToken[] |
getOutstandingDelTokens() |
java.util.Vector<MqttToken> |
getOutstandingTokens() |
MqttToken |
getToken(MqttWireMessage message)
Based on the message type that has just been received return the associated token from the token store or null if
one does not exist.
|
MqttToken |
getToken(java.lang.String key) |
void |
open() |
protected void |
quiesce(MqttException quiesceResponse) |
MqttToken |
removeToken(MqttWireMessage message) |
MqttToken |
removeToken(java.lang.String key) |
protected MqttDeliveryToken |
restoreToken(MqttPublish message)
Restores a token after a client restart.
|
protected void |
saveToken(MqttToken token,
MqttWireMessage message) |
protected void |
saveToken(MqttToken token,
java.lang.String key) |
java.lang.String |
toString() |
@Nullable public MqttToken getToken(MqttWireMessage message)
message
- whose token is to be returned@Nullable public MqttToken getToken(java.lang.String key)
@Nullable public MqttToken removeToken(@Nullable MqttWireMessage message)
@Nullable public MqttToken removeToken(@Nullable java.lang.String key)
protected MqttDeliveryToken restoreToken(MqttPublish message)
protected void saveToken(MqttToken token, MqttWireMessage message) throws MqttException
MqttException
protected void saveToken(MqttToken token, java.lang.String key)
protected void quiesce(MqttException quiesceResponse)
public void open()
public MqttDeliveryToken[] getOutstandingDelTokens()
public java.util.Vector<MqttToken> getOutstandingTokens()
public void clear()
public int count()
public java.lang.String toString()
toString
in class java.lang.Object