Class RedisConnectionUtil
java.lang.Object
io.micronaut.configuration.lettuce.RedisConnectionUtil
Internal utility methods for configuration.
- Since:
- 1.0
- Author:
- Graeme Rocher, Illia Kovalov
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic @NonNull io.lettuce.core.AbstractRedisClientfindClient(io.micronaut.context.BeanLocator beanLocator, Optional<String> serverName, String errorMessage) Utility method for establishing a redis connection.static io.lettuce.core.api.StatefulConnectionfindRedisConnection(io.micronaut.context.BeanLocator beanLocator, Optional<String> serverName, String errorMessage) Utility method for establishing a redis connection.static io.lettuce.core.api.StatefulConnection<byte[],byte[]> openBytesRedisConnection(io.micronaut.context.BeanLocator beanLocator, Optional<String> serverName, String errorMessage) Utility method for opening a new bytes redis connection.
- 
Constructor Details- 
RedisConnectionUtilpublic RedisConnectionUtil()
 
- 
- 
Method Details- 
findClient@NonNull public static @NonNull io.lettuce.core.AbstractRedisClient findClient(io.micronaut.context.BeanLocator beanLocator, Optional<String> serverName, String errorMessage) Utility method for establishing a redis connection.- Parameters:
- beanLocator- The bean locator to use
- serverName- The server name to use
- errorMessage- The error message to use if the connection can't be found
- Returns:
- The connection
- Throws:
- io.micronaut.context.exceptions.ConfigurationException- If the connection cannot be found
 
- 
findRedisConnectionpublic static io.lettuce.core.api.StatefulConnection findRedisConnection(io.micronaut.context.BeanLocator beanLocator, Optional<String> serverName, String errorMessage) Utility method for establishing a redis connection.- Parameters:
- beanLocator- The bean locator to use
- serverName- The server name to use
- errorMessage- The error message to use if the connection can't be found
- Returns:
- The connection
- Throws:
- io.micronaut.context.exceptions.ConfigurationException- If the connection cannot be found
 
- 
openBytesRedisConnectionpublic static io.lettuce.core.api.StatefulConnection<byte[],byte[]> openBytesRedisConnection(io.micronaut.context.BeanLocator beanLocator, Optional<String> serverName, String errorMessage) Utility method for opening a new bytes redis connection.- Parameters:
- beanLocator- The bean locator to use
- serverName- The server name to use
- errorMessage- The error message to use if the connection can't be found
- Returns:
- The connection
- Throws:
- io.micronaut.context.exceptions.ConfigurationException- If the connection cannot be found
 
 
-