Interface TransactionalRedisDataSource
-
- All Known Implementing Classes:
BlockingTransactionalRedisDataSourceImpl
public interface TransactionalRedisDataSourceRedis Data Source object used to execute commands in a Redis transaction (MULTI). Note that the results of the enqueued commands are not available until the completion of the transaction.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default TransactionalBitMapCommands<String>bitmap()Gets the object to execute commands manipulating bitmap data structures.<K> TransactionalBitMapCommands<K>bitmap(Class<K> redisKeyType)Gets the object to execute commands manipulating bitmap data structures.voiddiscard()Discard the current transaction.booleandiscarded()Checks if the current transaction has been discarded by the uservoidexecute(io.vertx.mutiny.redis.client.Command command, String... args)Executes a command.voidexecute(io.vertx.redis.client.Command command, String... args)Executes a command.voidexecute(String command, String... args)Executes a command.<K,V>
TransactionalGeoCommands<K,V>geo(Class<K> redisKeyType, Class<V> memberType)Gets the object to execute commands manipulating geo items (a.k.a.default <V> TransactionalGeoCommands<String,V>geo(Class<V> memberType)Gets the object to execute commands manipulating geo items (a.k.a.<K,F,V>
TransactionalHashCommands<K,F,V>hash(Class<K> redisKeyType, Class<F> typeOfField, Class<V> typeOfValue)Gets the object to execute commands manipulating hashes (a.k.a.default <V> TransactionalHashCommands<String,String,V>hash(Class<V> typeOfValue)Gets the object to execute commands manipulating hashes (a.k.a.<K,V>
TransactionalHyperLogLogCommands<K,V>hyperloglog(Class<K> redisKeyType, Class<V> memberType)Gets the object to execute commands manipulating hyperloglog data structures.default <V> TransactionalHyperLogLogCommands<String,V>hyperloglog(Class<V> memberType)Gets the object to execute commands manipulating hyperloglog data structures.default TransactionalKeyCommands<String>key()Gets the object to execute commands manipulating keys and expiration times.<K> TransactionalKeyCommands<K>key(Class<K> redisKeyType)Gets the object to execute commands manipulating keys and expiration times.<K,V>
TransactionalListCommands<K,V>list(Class<K> redisKeyType, Class<V> memberType)Gets the object to execute commands manipulating lists.default <V> TransactionalListCommands<String,V>list(Class<V> memberType)Gets the object to execute commands manipulating lists.<K,V>
TransactionalSetCommands<K,V>set(Class<K> redisKeyType, Class<V> memberType)Gets the object to execute commands manipulating sets.default <V> TransactionalSetCommands<String,V>set(Class<V> memberType)Gets the object to execute commands manipulating sets.<K,V>
TransactionalSortedSetCommands<K,V>sortedSet(Class<K> redisKeyType, Class<V> valueType)Gets the object to execute commands manipulating sorted sets.default <V> TransactionalSortedSetCommands<String,V>sortedSet(Class<V> valueType)Gets the object to execute commands manipulating sorted sets.<K,V>
TransactionalStringCommands<K,V>string(Class<K> redisKeyType, Class<V> valueType)Deprecated.Usevalue(Class, Class)instead.default <V> TransactionalStringCommands<String,V>string(Class<V> valueType)Deprecated.Usevalue(Class)instead<K,V>
TransactionalValueCommands<K,V>value(Class<K> redisKeyType, Class<V> valueType)Gets the object to execute commands manipulating stored strings.default <V> TransactionalValueCommands<String,V>value(Class<V> valueType)Gets the object to execute commands manipulating stored strings.
-
-
-
Method Detail
-
discard
void discard()
Discard the current transaction.
-
discarded
boolean discarded()
Checks if the current transaction has been discarded by the user- Returns:
- if the current transaction has been discarded by the user
-
hash
<K,F,V> TransactionalHashCommands<K,F,V> hash(Class<K> redisKeyType, Class<F> typeOfField, Class<V> typeOfValue)
Gets the object to execute commands manipulating hashes (a.k.a.Map<F, V>).If you want to use a hash of
<String -> Person>stored using String identifier, you would use:hash(String.class, String.class, Person.class). If you want to use a hash of<String -> Person>stored using UUID identifier, you would use:hash(UUID.class, String.class, Person.class).- Type Parameters:
K- the type of the redis keyF- the type of the fields (map's keys)V- the type of the value- Parameters:
redisKeyType- the class of the keystypeOfField- the class of the fieldstypeOfValue- the class of the values- Returns:
- the object to execute commands manipulating hashes (a.k.a.
Map<K, V>).
-
hash
default <V> TransactionalHashCommands<String,String,V> hash(Class<V> typeOfValue)
Gets the object to execute commands manipulating hashes (a.k.a.Map<String, V>).This is a shortcut on
hash(String.class, String.class, V)- Type Parameters:
V- the type of the value- Parameters:
typeOfValue- the class of the values- Returns:
- the object to execute commands manipulating hashes (a.k.a.
Map<String, V>).
-
geo
<K,V> TransactionalGeoCommands<K,V> geo(Class<K> redisKeyType, Class<V> memberType)
Gets the object to execute commands manipulating geo items (a.k.a.{longitude, latitude, member}).Vrepresents the type of the member, i.e. the localized thing.- Type Parameters:
K- the type of the redis keyV- the type of the member- Parameters:
redisKeyType- the class of the keysmemberType- the class of the members- Returns:
- the object to execute geo commands.
-
geo
default <V> TransactionalGeoCommands<String,V> geo(Class<V> memberType)
Gets the object to execute commands manipulating geo items (a.k.a.{longitude, latitude, member}).Vrepresents the type of the member, i.e. the localized thing.- Type Parameters:
V- the type of the member- Parameters:
memberType- the class of the members- Returns:
- the object to execute geo commands.
-
key
<K> TransactionalKeyCommands<K> key(Class<K> redisKeyType)
Gets the object to execute commands manipulating keys and expiration times.- Type Parameters:
K- the type of the key- Parameters:
redisKeyType- the type of the keys- Returns:
- the object to execute commands manipulating keys.
-
key
default TransactionalKeyCommands<String> key()
Gets the object to execute commands manipulating keys and expiration times.- Returns:
- the object to execute commands manipulating keys.
-
sortedSet
<K,V> TransactionalSortedSetCommands<K,V> sortedSet(Class<K> redisKeyType, Class<V> valueType)
Gets the object to execute commands manipulating sorted sets.- Type Parameters:
K- the type of the keyV- the type of the value- Parameters:
redisKeyType- the type of the keysvalueType- the type of the value sorted in the sorted sets- Returns:
- the object to manipulate sorted sets.
-
sortedSet
default <V> TransactionalSortedSetCommands<String,V> sortedSet(Class<V> valueType)
Gets the object to execute commands manipulating sorted sets.- Type Parameters:
V- the type of the value- Parameters:
valueType- the type of the value sorted in the sorted sets- Returns:
- the object to manipulate sorted sets.
-
value
<K,V> TransactionalValueCommands<K,V> value(Class<K> redisKeyType, Class<V> valueType)
Gets the object to execute commands manipulating stored strings.NOTE: Instead of
string, this group is namedvalueto avoid the confusion with the Java String type. Indeed, Redis strings can be strings, numbers, byte arrays...- Type Parameters:
K- the type of the keyV- the type of the value- Parameters:
redisKeyType- the type of the keysvalueType- the type of the value, often String, or the value are encoded/decoded using codecs.- Returns:
- the object to manipulate stored strings.
-
value
default <V> TransactionalValueCommands<String,V> value(Class<V> valueType)
Gets the object to execute commands manipulating stored strings.NOTE: Instead of
string, this group is namedvalueto avoid the confusion with the Java String type. Indeed, Redis strings can be strings, numbers, byte arrays...- Type Parameters:
V- the type of the value- Parameters:
valueType- the type of the value, often String, or the value are encoded/decoded using codecs.- Returns:
- the object to manipulate stored strings.
-
string
@Deprecated <K,V> TransactionalStringCommands<K,V> string(Class<K> redisKeyType, Class<V> valueType)
Deprecated.Usevalue(Class, Class)instead.Gets the object to execute commands manipulating stored strings.- Type Parameters:
K- the type of the keyV- the type of the value- Parameters:
redisKeyType- the type of the keysvalueType- the type of the value, often String, or the value are encoded/decoded using codecs.- Returns:
- the object to manipulate stored strings.
-
string
@Deprecated default <V> TransactionalStringCommands<String,V> string(Class<V> valueType)
Deprecated.Usevalue(Class)insteadGets the object to execute commands manipulating stored strings.- Type Parameters:
V- the type of the value- Parameters:
valueType- the type of the value, often String, or the value are encoded/decoded using codecs.- Returns:
- the object to manipulate stored strings.
-
set
<K,V> TransactionalSetCommands<K,V> set(Class<K> redisKeyType, Class<V> memberType)
Gets the object to execute commands manipulating sets.- Type Parameters:
K- the type of the keyV- the type of the member- Parameters:
redisKeyType- the type of the keysmemberType- the type of the member stored in each set- Returns:
- the object to manipulate sets.
-
set
default <V> TransactionalSetCommands<String,V> set(Class<V> memberType)
Gets the object to execute commands manipulating sets.- Type Parameters:
V- the type of the member- Parameters:
memberType- the type of the member stored in each set- Returns:
- the object to manipulate sets.
-
list
<K,V> TransactionalListCommands<K,V> list(Class<K> redisKeyType, Class<V> memberType)
Gets the object to execute commands manipulating lists.- Type Parameters:
K- the type of the keyV- the type of the member- Parameters:
redisKeyType- the type of the keysmemberType- the type of the member stored in each list- Returns:
- the object to manipulate sets.
-
list
default <V> TransactionalListCommands<String,V> list(Class<V> memberType)
Gets the object to execute commands manipulating lists.- Type Parameters:
V- the type of the member- Parameters:
memberType- the type of the member stored in each list- Returns:
- the object to manipulate sets.
-
hyperloglog
<K,V> TransactionalHyperLogLogCommands<K,V> hyperloglog(Class<K> redisKeyType, Class<V> memberType)
Gets the object to execute commands manipulating hyperloglog data structures.- Type Parameters:
K- the type of the keyV- the type of the member- Parameters:
redisKeyType- the type of the keysmemberType- the type of the member stored in the data structure- Returns:
- the object to manipulate hyper log log data structures.
-
hyperloglog
default <V> TransactionalHyperLogLogCommands<String,V> hyperloglog(Class<V> memberType)
Gets the object to execute commands manipulating hyperloglog data structures.- Type Parameters:
V- the type of the member- Parameters:
memberType- the type of the member stored in the data structure- Returns:
- the object to manipulate hyper log log data structures.
-
bitmap
<K> TransactionalBitMapCommands<K> bitmap(Class<K> redisKeyType)
Gets the object to execute commands manipulating bitmap data structures.- Type Parameters:
K- the type of the key- Parameters:
redisKeyType- the type of the keys- Returns:
- the object to manipulate bitmap data structures.
-
bitmap
default TransactionalBitMapCommands<String> bitmap()
Gets the object to execute commands manipulating bitmap data structures.- Returns:
- the object to manipulate bitmap data structures.
-
execute
void execute(String command, String... args)
Executes a command. This method is used to execute commands not offered by the API.- Parameters:
command- the command nameargs- the parameters, encoded as String.
-
execute
void execute(io.vertx.mutiny.redis.client.Command command, String... args)Executes a command. This method is used to execute commands not offered by the API.- Parameters:
command- the commandargs- the parameters, encoded as String.
-
execute
void execute(io.vertx.redis.client.Command command, String... args)Executes a command. This method is used to execute commands not offered by the API.- Parameters:
command- the commandargs- the parameters, encoded as String.
-
-