Class AbstractRedisClientFactory<K,V>
java.lang.Object
io.micronaut.configuration.lettuce.AbstractRedisClientFactory<K,V>
- Type Parameters:
K
- Key typeV
- Value type
- Direct Known Subclasses:
DefaultRedisClientFactory
,NamedRedisClientFactory
Abstract version of a factory class for creating Redis clients.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Modifier and TypeFieldDescription -
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractRedisClientFactory
(io.lettuce.core.codec.RedisCodec<K, V> defaultCodec) -
Method Summary
Modifier and TypeMethodDescriptionio.lettuce.core.RedisClient
Creates theRedisClient
from the configuration.io.lettuce.core.RedisClient
redisClient
(AbstractRedisConfiguration config, @Nullable io.lettuce.core.resource.ClientResources optionalClientResources, @Nullable List<ClientResourcesMutator> mutators) Creates theRedisClient
from the configuration.redisConnection
(io.lettuce.core.RedisClient redisClient, io.lettuce.core.codec.RedisCodec<K, V> codec) Creates theStatefulRedisConnection
from theRedisClient
.redisPubSubConnection
(io.lettuce.core.RedisClient redisClient, io.lettuce.core.codec.RedisCodec<K, V> codec) Creates theStatefulRedisPubSubConnection
from theRedisClient
.
-
Field Details
-
defaultCodec
-
-
Constructor Details
-
AbstractRedisClientFactory
- Parameters:
defaultCodec
- The default codec
-
-
Method Details
-
redisClient
Creates theRedisClient
from the configuration.- Parameters:
config
- The configuration- Returns:
- The
RedisClient
-
redisClient
public io.lettuce.core.RedisClient redisClient(AbstractRedisConfiguration config, @Nullable @Nullable io.lettuce.core.resource.ClientResources optionalClientResources, @Nullable @Nullable List<ClientResourcesMutator> mutators) Creates theRedisClient
from the configuration.- Parameters:
config
- The configurationoptionalClientResources
- The ClientResourcesmutators
- The list of mutators- Returns:
- The
RedisClient
-
redisConnection
public io.lettuce.core.api.StatefulRedisConnection<K,V> redisConnection(io.lettuce.core.RedisClient redisClient, io.lettuce.core.codec.RedisCodec<K, V> codec) Creates theStatefulRedisConnection
from theRedisClient
.- Parameters:
redisClient
- TheRedisClient
codec
- The codec to use- Returns:
- The
StatefulRedisConnection
-
redisPubSubConnection
public io.lettuce.core.pubsub.StatefulRedisPubSubConnection<K,V> redisPubSubConnection(io.lettuce.core.RedisClient redisClient, io.lettuce.core.codec.RedisCodec<K, V> codec) Creates theStatefulRedisPubSubConnection
from theRedisClient
.- Parameters:
redisClient
- TheRedisClient
codec
- The codec to use- Returns:
- The
StatefulRedisPubSubConnection
-