Class RedisConnectionUtil


  • @Internal
    public class RedisConnectionUtil
    extends java.lang.Object
    Internal utility methods for configuration.
    Since:
    1.0
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static io.lettuce.core.AbstractRedisClient findClient​(io.micronaut.context.BeanLocator beanLocator, java.util.Optional<java.lang.String> serverName, java.lang.String errorMessage)
      Utility method for establishing a redis connection.
      static io.lettuce.core.api.StatefulConnection findRedisConnection​(io.micronaut.context.BeanLocator beanLocator, java.util.Optional<java.lang.String> serverName, java.lang.String errorMessage)
      Utility method for establishing a redis connection.
      static io.lettuce.core.api.StatefulConnection<byte[],​byte[]> openBytesRedisConnection​(io.micronaut.context.BeanLocator beanLocator, java.util.Optional<java.lang.String> serverName, java.lang.String errorMessage)
      Utility method for opening a new bytes redis connection.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • RedisConnectionUtil

        public RedisConnectionUtil()
    • Method Detail

      • findClient

        @NonNull
        public static io.lettuce.core.AbstractRedisClient findClient​(io.micronaut.context.BeanLocator beanLocator,
                                                                     java.util.Optional<java.lang.String> serverName,
                                                                     java.lang.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,
                                                                                 java.util.Optional<java.lang.String> serverName,
                                                                                 java.lang.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,
                                                                                                           java.util.Optional<java.lang.String> serverName,
                                                                                                           java.lang.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