Interface LettuceConnectionProvider.TargetAware

Enclosing interface:
LettuceConnectionProvider
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface LettuceConnectionProvider.TargetAware
Extension to LettuceConnectionProvider for providers that allow connection creation to specific nodes.
  • Method Summary

    Modifier and Type
    Method
    Description
    default <T extends io.lettuce.core.api.StatefulConnection<?, ?>>
    T
    getConnection(Class<T> connectionType, io.lettuce.core.RedisURI redisURI)
    Request a connection given connectionType for a specific RedisURI.
    <T extends io.lettuce.core.api.StatefulConnection<?, ?>>
    CompletionStage<T>
    getConnectionAsync(Class<T> connectionType, io.lettuce.core.RedisURI redisURI)
    Request asynchronously a connection given connectionType for a specific RedisURI.
  • Method Details

    • getConnection

      default <T extends io.lettuce.core.api.StatefulConnection<?, ?>> T getConnection(Class<T> connectionType, io.lettuce.core.RedisURI redisURI)
      Request a connection given connectionType for a specific RedisURI. Providing a connection type allows specialization to provide a more specific connection type.
      Parameters:
      connectionType - must not be null.
      redisURI - must not be null.
      Returns:
      the requested connection.
    • getConnectionAsync

      <T extends io.lettuce.core.api.StatefulConnection<?, ?>> CompletionStage<T> getConnectionAsync(Class<T> connectionType, io.lettuce.core.RedisURI redisURI)
      Request asynchronously a connection given connectionType for a specific RedisURI. Providing a connection type allows specialization to provide a more specific connection type.
      Parameters:
      connectionType - must not be null.
      redisURI - must not be null.
      Returns:
      a CompletionStage that is notified with the connection progress.
      Since:
      2.2