public interface BlockingSessionAttributeStore
The session attribute store is only available for clients which already have a session available.
When a client connects, the earliest point in time to use the session attribute store for the client is the OnSessionReadyCallback.
The session attribute store is only available when all nodes in the HiveMQ cluster are at version 3.3.0 or above.
| Modifier and Type | Method and Description |
|---|---|
void |
clear(String clientId)
Clears all session attributes for the connected client.
|
com.google.common.base.Optional<byte[]> |
get(String clientId,
String key)
Retrieves the value of the session attribute with the given key for a persistent client.
|
com.google.common.base.Optional<com.google.common.collect.ImmutableMap<String,byte[]>> |
getAll(String clientId)
Retrieves all session attributes for a persistent client.
|
com.google.common.base.Optional<String> |
getAsString(String clientId,
String key)
Retrieves the value of the session attribute with the given key for a persistent client.
|
com.google.common.base.Optional<String> |
getAsString(String clientId,
String key,
Charset charset)
Retrieves the value of the session attribute with the given key for a persistent client.
|
void |
put(String clientId,
String key,
byte[] value)
Sets the given session attribute for a persistent client.
|
void |
putAsString(String clientId,
String key,
String value)
Sets the given session attribute for a persistent client.
|
void |
putAsString(String clientId,
String key,
String value,
Charset charset)
Sets the given session attribute for a persistent client.
|
OptionalAttribute |
putIfNewer(String clientId,
String key,
byte[] value,
long timestamp)
Sets the given session attribute for a persistent client if the timestamp of the attribute is newer than the timestamp of the already stored attribute.
|
OptionalAttribute |
putIfNewerOrEquals(String clientId,
String key,
byte[] value,
long timestamp)
Sets the given session attribute for a persistent client if the timestamp of the attribute is newer than or equal to the timestamp of the already stored attribute.
|
com.google.common.base.Optional<byte[]> |
remove(String clientId,
String key)
Removes the session attribute with the given key for a persistent client.
|
void put(@NotNull String clientId, @NotNull String key, @NotNull byte[] value) throws NoSuchClientIdException
clientId - the clientId of a persistent client.key - the key of the session attribute.value - the value of the session attribute.NoSuchClientIdException - if no session for the given clientId exists.IncompatibleHiveMQVersionException - if a node with a version lower than 3.3.0 exists in the cluster.RateLimitExceededException - if the plugin service rate limit was exceeded.@NotNull OptionalAttribute putIfNewer(@NotNull String clientId, @NotNull String key, @NotNull byte[] value, long timestamp) throws NoSuchClientIdException
clientId - the clientId of a persistent client.key - the key of the session attribute.value - the value of the session attribute.timestamp - the timestamp of the session attribute.OptionalAttribute with the previous associated value or null and a boolean if a value was replaced or not.
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.0 exists in the cluster.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.NoSuchClientIdException@NotNull OptionalAttribute putIfNewerOrEquals(@NotNull String clientId, @NotNull String key, @NotNull byte[] value, long timestamp) throws NoSuchClientIdException
clientId - the clientId of a persistent client.key - the key of the session attribute.value - the value of the session attribute.timestamp - the timestamp of the session attribute.OptionalAttribute with the previous associated value or null and a boolean if a value was replaced or not.
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.0 exists in the cluster.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.NoSuchClientIdExceptionvoid putAsString(@NotNull String clientId, @NotNull String key, @NotNull String value) throws NoSuchClientIdException
clientId - the clientId of a persistent client.key - the key of the session attribute.value - the value of the session attribute as a string.NoSuchClientIdException - if no session for the given clientId exists.IncompatibleHiveMQVersionException - if a node with a version lower than 3.3.0 exists in the cluster.RateLimitExceededException - if the plugin service rate limit was exceeded.void putAsString(@NotNull String clientId, @NotNull String key, @NotNull String value, @NotNull Charset charset) throws NoSuchClientIdException
clientId - the clientId of a persistent client.key - the key of the session attribute.value - the value of the session attribute as a string.charset - the Charset of the given value.NoSuchClientIdException - if no session for the given clientId exists.IncompatibleHiveMQVersionException - if a node with a version lower than 3.3.0 exists in the cluster.RateLimitExceededException - if the plugin service rate limit was exceeded.@NotNull com.google.common.base.Optional<byte[]> get(@NotNull String clientId, @NotNull String key) throws NoSuchClientIdException
clientId - the clientId of a persistent client.key - the key of the session attribute.Optional containing the value of the session attribute if present.NoSuchClientIdException - if no session for the given clientId exists.IncompatibleHiveMQVersionException - if a node with a version lower than 3.3.0 exists in the cluster.RateLimitExceededException - if the plugin service rate limit was exceeded.@NotNull com.google.common.base.Optional<String> getAsString(@NotNull String clientId, @NotNull String key) throws NoSuchClientIdException
clientId - the clientId of a persistent client.key - the key of the session attribute.Optional containing the value of the session attribute if present.NoSuchClientIdException - if no session for the given clientId exists.IncompatibleHiveMQVersionException - if a node with a version lower than 3.3.0 exists in the cluster.RateLimitExceededException - if the plugin service rate limit was exceeded.@NotNull com.google.common.base.Optional<String> getAsString(@NotNull String clientId, @NotNull String key, @NotNull Charset charset) throws NoSuchClientIdException
clientId - the clientId of a persistent client.key - the key of the session attribute.charset - the Charset of the given value.Optional containing the value of the session attribute if present.NoSuchClientIdException - if no session for the given clientId exists.IncompatibleHiveMQVersionException - if a node with a version lower than 3.3.0 exists in the cluster.RateLimitExceededException - if the plugin service rate limit was exceeded.@NotNull com.google.common.base.Optional<byte[]> remove(@NotNull String clientId, @NotNull String key) throws NoSuchClientIdException
clientId - the clientId of a persistent client.key - the key of the session attribute.Optional containing the value of the removed session attribute if it was present.NoSuchClientIdException - if no session for the given clientId exists.IncompatibleHiveMQVersionException - if a node with a version lower than 3.3.0 exists in the cluster.RateLimitExceededException - if the plugin service rate limit was exceeded.@NotNull com.google.common.base.Optional<com.google.common.collect.ImmutableMap<String,byte[]>> getAll(@NotNull String clientId) throws NoSuchClientIdException
clientId - the clientId of a persistent client.Optional containing all session attributes as a map of key and value pairs if present.NoSuchClientIdException - if no session for the given clientId exists.IncompatibleHiveMQVersionException - if a node with a version lower than 3.3.0 exists in the cluster.RateLimitExceededException - if the plugin service rate limit was exceeded.void clear(@NotNull String clientId) throws NoSuchClientIdException
clientId - the clientId of a persistent client.NoSuchClientIdException - if no session for the given clientId exists.IncompatibleHiveMQVersionException - if a node with a version lower than 3.3.0 exists in the cluster.RateLimitExceededException - if the plugin service rate limit was exceeded.Copyright © 2013-2018 dc-square GmbH. All Rights Reserved.