public interface BlockingClientService
| Modifier and Type | Method and Description |
|---|---|
boolean |
disconnectClient(String clientId)
Forcefully disconnect a client with the specified clientId.
|
boolean |
disconnectClient(String clientId,
boolean preventLwtMessage)
Forcefully disconnect a client with the specified clientId.
|
ClientData |
getClientData(String clientId)
Returns additional client information about a given client with a given client identifier.
|
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.
|
Set<String> |
getDisconnectedClients()
Returns all disconnected clients which have a persistent MQTT session on this broker or any other cluster node.
|
ClientData |
getLocalClientData(String clientId)
Returns client information for clients that are connected to this broker instance.
|
Set<String> |
getLocalConnectedClients()
Returns all identifiers of connected clients of this HiveMQ Node.
|
Set<String> |
getLocalDisconnectedClients()
Returns all disconnected clients which have a persistent MQTT session on this instance of HiveMQ (MQTT clean session=false).
|
int |
getTTL(String clientId)
Returns the time to live for a client session in seconds.
|
void |
invalidateSession(String clientId)
Invalidates the client session for the client with the given client identifier.
|
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.
|
boolean |
isClientConnectedLocal(String clientId)
Check if a client with a given identifier is currently connected to this HiveMQ instance.
|
void |
setTTL(String clientId,
int ttl)
Sets the time to live for the client session.
|
Set<String> getLocalConnectedClients()
RateLimitExceededException - if the plugin service rate limit was exceeded.Set<String> getLocalDisconnectedClients()
RateLimitExceededException - if the plugin service rate limit was exceeded.boolean isClientConnectedLocal(String clientId)
clientId - client, which should be checkedRateLimitExceededException - if the plugin service rate limit was exceeded.@Nullable ClientData getLocalClientData(String clientId)
null will be returned.clientId - the client identifier of the clientClientData for a specific client or null if the client is not connectedRateLimitExceededException - if the plugin service rate limit was exceeded.Set<String> getConnectedClients()
RateLimitExceededException - if the plugin service rate limit was exceeded.Set<String> getDisconnectedClients()
RateLimitExceededException - if the plugin service rate limit was exceeded.boolean isClientConnected(String clientId)
clientId - client, which should be checkedRateLimitExceededException - if the plugin service rate limit was exceeded.@Nullable ClientData getClientData(String clientId)
null will be returned.clientId - the client identifier of the clientClientData for a specific client or null if the client is not connectedRateLimitExceededException - if the plugin service rate limit was exceeded.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 disconnectRateLimitExceededException - if the plugin service rate limit was exceeded.boolean disconnectClient(String clientId, boolean preventLwtMessage)
If the client specified a LWT message, it will only be sent if the boolean parameter is false
clientId - the clientId to disconnectpreventLwtMessage - if true the LWT message for this client is not sentRateLimitExceededException - if the plugin service rate limit was exceeded.void setTTL(@NotNull String clientId, int ttl) throws NoSuchClientIdException
clientId - the client identifier of the clientttl - time to live for a client session in secondsNoSuchClientIdException - if no session for the given clientId existsIncompatibleHiveMQVersionException - if a node with a version lower than 3.4 exists in the clusterInvalidTTLException - if the given TTL is invalid (< -1)int getTTL(@NotNull String clientId) throws NoSuchClientIdException
clientId - the client identifier of the clientNoSuchClientIdException - if no session for the given clientId existscom.hivemq.spi.services.exception.IncompatibleHiveMQVersionException} - if a node with a version lower than 3.4 exists in the clustervoid invalidateSession(@NotNull String clientId) throws NoSuchClientIdException
clientId - the client identifier of the client whose session should be invalidatedNoSuchClientIdException - if no session for the given clientId existscom.hivemq.spi.services.exception.IncompatibleHiveMQVersionException} - if a node with a version lower than 3.4 exists in the clusterCopyright © 2013-2018 dc-square GmbH. All Rights Reserved.