public interface AsyncClientService
| Modifier and Type | Method and Description |
|---|---|
com.google.common.util.concurrent.ListenableFuture<Boolean> |
disconnectClient(String clientId)
Forcefully disconnect a client with the specified clientId.
|
com.google.common.util.concurrent.ListenableFuture<Boolean> |
disconnectClient(String clientId,
boolean preventLwtMessage)
Forcefully disconnect a client with the specified clientId.
|
com.google.common.util.concurrent.ListenableFuture<ClientData> |
getClientData(String clientId)
Returns additional client information about a given client with a given client identifier.
|
com.google.common.util.concurrent.ListenableFuture<Set<String>> |
getConnectedClients()
Returns all identifiers of connected clients of this HiveMQ instance and all other nodes in a HiveMQ cluster
Calling this method frequently in a clustered environment could have negative performance effects.
|
com.google.common.util.concurrent.ListenableFuture<Set<String>> |
getDisconnectedClients()
Returns all disconnected clients which have a persistent MQTT session on this broker or any other cluster node.
|
com.google.common.util.concurrent.ListenableFuture<ClientData> |
getLocalClientData(String clientId)
Returns client information for clients that are connected to this broker instance.
|
com.google.common.util.concurrent.ListenableFuture<Set<String>> |
getLocalConnectedClients()
Returns all identifiers of connected clients of this HiveMQ Node.
|
com.google.common.util.concurrent.ListenableFuture<Set<String>> |
getLocalDisconnectedClients()
Returns all disconnected clients which have a persistent MQTT session on this instance of HiveMQ (MQTT clean session=false).
|
com.google.common.util.concurrent.ListenableFuture<Integer> |
getTTL(String clientId)
Returns the time to live for a client session in seconds.
|
com.google.common.util.concurrent.ListenableFuture<Boolean> |
invalidateSession(String clientId)
Invalidates the client session for a client with the given client identifier.
|
com.google.common.util.concurrent.ListenableFuture<Boolean> |
isClientConnected(String clientId)
Check if a client with a given identifier is currently connected to this HiveMQ broker instance or any other instance in the cluster.
|
com.google.common.util.concurrent.ListenableFuture<Boolean> |
isClientConnectedLocal(String clientId)
Check if a client with a given identifier is currently connected to this HiveMQ instance.
|
com.google.common.util.concurrent.ListenableFuture<Void> |
setTTL(String clientId,
int ttl)
Sets the time to live for a client session in seconds.
|
com.google.common.util.concurrent.ListenableFuture<Set<String>> getLocalConnectedClients()
ListenableFuture which contains all client identifiers of all connected clients
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.com.google.common.util.concurrent.ListenableFuture<Set<String>> getLocalDisconnectedClients()
ListenableFuture which contains the client identifiers of all disconnected clients with a persistent MQTT session
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.com.google.common.util.concurrent.ListenableFuture<Boolean> isClientConnectedLocal(String clientId)
clientId - client, which should be checkedListenableFuture which contains true, if a certain client is currently connected and false otherwise
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.com.google.common.util.concurrent.ListenableFuture<ClientData> getLocalClientData(String clientId)
Optional with absent data.clientId - the client identifier of the clientListenableFuture which contains the ClientData for a specific client.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.com.google.common.util.concurrent.ListenableFuture<Set<String>> getConnectedClients()
ListenableFuture which contains the client identifiers of all connected clients
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.com.google.common.util.concurrent.ListenableFuture<Set<String>> getDisconnectedClients()
ListenableFuture which contains the of client identifiers of all disconnected clients with a persistent MQTT session
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.com.google.common.util.concurrent.ListenableFuture<Boolean> isClientConnected(String clientId)
clientId - client, which should be checkedListenableFuture which contains true, if a certain client is currently connected and false otherwise
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.com.google.common.util.concurrent.ListenableFuture<ClientData> getClientData(String clientId)
clientId - the client identifier of the clientListenableFuture which contains the ClientData for a specific client.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.com.google.common.util.concurrent.ListenableFuture<Boolean> disconnectClient(String clientId)
If the client specified a LWT message, it will be sent.
To prevent LWT messages use the disconnectClient(String, boolean) method
clientId - the clientId to disconnectListenableFuture which contains a Boolean which is true when the client has been disconnected and false if no client with that id was found.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.com.google.common.util.concurrent.ListenableFuture<Boolean> disconnectClient(String clientId, boolean preventLwtMessage)
If the client specified a LWT message it will only be sent if the boolean parameter is set to false.
clientId - the clientId to disconnectpreventLwtMessage - if true the LWT message for this client is not published when the client gets disconnectedListenableFuture which contains a Boolean which is true when the client has been disconnected and false if no client with that id was found.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.com.google.common.util.concurrent.ListenableFuture<Void> setTTL(@NotNull String clientId, int ttl)
clientId - the client identifier of the clientttl - time to live for the client session in secondsListenableFuture which succeeds when the TTL is set successfully,
failing with a NoSuchClientIdException if no session for the given clientId exists,
failing with a IncompatibleHiveMQVersionException if a node with a version lower than 3.4 exists in the cluster,
failing with a InvalidTTLException if the given TTL is invalid (< -1).com.google.common.util.concurrent.ListenableFuture<Integer> getTTL(@NotNull String clientId)
clientId - the client identifier of the clientListenableFuture succeeding with the client session TTL in seconds,
failing with a NoSuchClientIdException if no session for the given clientId exists,
failing with a IncompatibleHiveMQVersionException if a node with a version lower than 3.4 exists in the cluster.com.google.common.util.concurrent.ListenableFuture<Boolean> invalidateSession(@NotNull String clientId)
clientId - the client identifier of the client which session should be invalidatedListenableFuture succeeding with a Boolean which is true when the client has been actively disconnected by the broker otherwise false,
failing with a NoSuchClientIdException if no session for the given clientId exists,
failing with a IncompatibleHiveMQVersionException if a node with a version lower than 3.4 exists in the cluster.Copyright © 2013-2018 dc-square GmbH. All Rights Reserved.