-
public class CommsTokenStoreProvides a "token" based system for storing and tracking actions across multiple threads. When a message is sent, a token is associated with the message and saved using the saveToken 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 outstanding
-
-
Constructor Summary
Constructors Constructor Description CommsTokenStore(String logContext)
-
Method Summary
Modifier and Type Method Description MqttTokengetToken(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. MqttTokengetToken(String key)MqttTokenremoveToken(MqttWireMessage message)MqttTokenremoveToken(String key)voidopen()Array<MqttDeliveryToken>getOutstandingDelTokens()VectorgetOutstandingTokens()voidclear()Empties the token store without notifying any of the tokens. intcount()StringtoString()-
-
Constructor Detail
-
CommsTokenStore
CommsTokenStore(String logContext)
-
-
Method Detail
-
getToken
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.
- Parameters:
message- whose token is to be returned
-
removeToken
MqttToken removeToken(MqttWireMessage message)
-
removeToken
MqttToken removeToken(String key)
-
open
void open()
-
getOutstandingDelTokens
Array<MqttDeliveryToken> getOutstandingDelTokens()
-
getOutstandingTokens
Vector getOutstandingTokens()
-
clear
void clear()
Empties the token store without notifying any of the tokens.
-
count
int count()
-
-
-
-