public interface AsyncSessionAttributeStore
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 |
|---|---|
com.google.common.util.concurrent.ListenableFuture<Void> |
clear(String clientId)
Clears all session attributes for a persistent client.
|
com.google.common.util.concurrent.ListenableFuture<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.util.concurrent.ListenableFuture<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.util.concurrent.ListenableFuture<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.util.concurrent.ListenableFuture<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.
|
com.google.common.util.concurrent.ListenableFuture<Void> |
put(String clientId,
String key,
byte[] value)
Sets the given session attribute for a persistent client.
|
com.google.common.util.concurrent.ListenableFuture<Void> |
putAsString(String clientId,
String key,
String value)
Sets the given session attribute for a persistent client.
|
com.google.common.util.concurrent.ListenableFuture<Void> |
putAsString(String clientId,
String key,
String value,
Charset charset)
Sets the given session attribute for a persistent client.
|
com.google.common.util.concurrent.ListenableFuture<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.
|
com.google.common.util.concurrent.ListenableFuture<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.util.concurrent.ListenableFuture<com.google.common.base.Optional<byte[]>> |
remove(String clientId,
String key)
Removes the session attribute with the given key for a persistent client.
|
@NotNull com.google.common.util.concurrent.ListenableFuture<Void> put(@NotNull String clientId, @NotNull String key, @NotNull byte[] value)
clientId - the clientId of a persistent client.key - the key of the session attribute.value - the value of the session attribute.ListenableFuture indicating success or
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.3.0 exists in the cluster.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.@NotNull com.google.common.util.concurrent.ListenableFuture<OptionalAttribute> putIfNewer(@NotNull String clientId, @NotNull String key, @NotNull byte[] value, long timestamp)
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.ListenableFuture 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.@NotNull com.google.common.util.concurrent.ListenableFuture<OptionalAttribute> putIfNewerOrEquals(@NotNull String clientId, @NotNull String key, @NotNull byte[] value, long timestamp)
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.ListenableFuture 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.@NotNull com.google.common.util.concurrent.ListenableFuture<Void> putAsString(@NotNull String clientId, @NotNull String key, @NotNull String value)
clientId - the clientId of a persistent client.key - the key of the session attribute.value - the value of the session attribute as a string.ListenableFuture indicating success or
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.3.0 exists in the cluster.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.@NotNull com.google.common.util.concurrent.ListenableFuture<Void> putAsString(@NotNull String clientId, @NotNull String key, @NotNull String value, @NotNull Charset charset)
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.ListenableFuture indicating success or
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.3.0 exists in the cluster.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.@NotNull com.google.common.util.concurrent.ListenableFuture<com.google.common.base.Optional<byte[]>> get(@NotNull String clientId, @NotNull String key)
clientId - the clientId of a persistent client.key - the key of the session attribute.ListenableFuture indicating success or
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.3.0 exists in the cluster.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.@NotNull com.google.common.util.concurrent.ListenableFuture<com.google.common.base.Optional<String>> getAsString(@NotNull String clientId, @NotNull String key)
clientId - the clientId of a persistent client.key - the key of the session attribute.ListenableFuture indicating success or
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.3.0 exists in the cluster.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.@NotNull com.google.common.util.concurrent.ListenableFuture<com.google.common.base.Optional<String>> getAsString(@NotNull String clientId, @NotNull String key, @NotNull Charset charset)
clientId - the clientId of a persistent client.key - the key of the session attribute.charset - the Charset of the given value.ListenableFuture indicating success or
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.3.0 exists in the cluster.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.@NotNull com.google.common.util.concurrent.ListenableFuture<com.google.common.base.Optional<byte[]>> remove(@NotNull String clientId, @NotNull String key)
clientId - the clientId of a persistent client.key - the key of the session attribute.ListenableFuture indicating success or
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.3.0 exists in the cluster.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.@NotNull com.google.common.util.concurrent.ListenableFuture<com.google.common.base.Optional<com.google.common.collect.ImmutableMap<String,byte[]>>> getAll(@NotNull String clientId)
clientId - the clientId of a persistent client.ListenableFuture indicating success or
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.3.0 exists in the cluster.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.@NotNull com.google.common.util.concurrent.ListenableFuture<Void> clear(@NotNull String clientId)
clientId - the clientId of a persistent client.ListenableFuture indicating success or
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.3.0 exists in the cluster.
failing with a RateLimitExceededException if the plugin service rate limit was exceeded.Copyright © 2013-2018 dc-square GmbH. All Rights Reserved.