Class RedisConnectionUtil

java.lang.Object
io.micronaut.configuration.lettuce.RedisConnectionUtil

@Internal public class RedisConnectionUtil extends Object
Internal utility methods for configuration.
Since:
1.0
Author:
Graeme Rocher, Illia Kovalov
  • Constructor Details

    • RedisConnectionUtil

      public 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
    • findRedisConnection

      public 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
    • openBytesRedisConnection

      public 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