Module lettuce.core

Interface RedisCommands<K,​V>

Type Parameters:
K - Key type.
V - Value type.
All Superinterfaces:
BaseRedisCommands<K,​V>, RedisAclCommands<K,​V>, RedisClusterCommands<K,​V>, RedisGeoCommands<K,​V>, RedisHashCommands<K,​V>, RedisHLLCommands<K,​V>, RedisKeyCommands<K,​V>, RedisListCommands<K,​V>, RedisScriptingCommands<K,​V>, RedisServerCommands<K,​V>, RedisSetCommands<K,​V>, RedisSortedSetCommands<K,​V>, RedisStreamCommands<K,​V>, RedisStringCommands<K,​V>, RedisTransactionalCommands<K,​V>
All Known Subinterfaces:
RedisClusterPubSubCommands<K,​V>, RedisPubSubCommands<K,​V>

public interface RedisCommands<K,​V>
extends BaseRedisCommands<K,​V>, RedisAclCommands<K,​V>, RedisClusterCommands<K,​V>, RedisGeoCommands<K,​V>, RedisHashCommands<K,​V>, RedisHLLCommands<K,​V>, RedisKeyCommands<K,​V>, RedisListCommands<K,​V>, RedisScriptingCommands<K,​V>, RedisServerCommands<K,​V>, RedisSetCommands<K,​V>, RedisSortedSetCommands<K,​V>, RedisStreamCommands<K,​V>, RedisStringCommands<K,​V>, RedisTransactionalCommands<K,​V>
A complete synchronous and thread-safe Redis API with 400+ Methods.
Since:
3.0
Author:
Mark Paluch
  • Method Details

    • auth

      String auth​(CharSequence password)
      Authenticate to the server.
      Specified by:
      auth in interface RedisClusterCommands<K,​V>
      Parameters:
      password - the password
      Returns:
      String simple-string-reply
    • auth

      String auth​(String username, CharSequence password)
      Authenticate to the server with username and password. Requires Redis 6 or newer.
      Specified by:
      auth in interface RedisClusterCommands<K,​V>
      Parameters:
      username - the username
      password - the password
      Returns:
      String simple-string-reply
      Since:
      6.0
    • select

      String select​(int db)
      Change the selected database for the current Commands.
      Parameters:
      db - the database number
      Returns:
      String simple-string-reply
    • swapdb

      String swapdb​(int db1, int db2)
      Swap two Redis databases, so that immediately all the clients connected to a given DB will see the data of the other DB, and the other way around
      Parameters:
      db1 - the first database number
      db2 - the second database number
      Returns:
      String simple-string-reply
    • getStatefulConnection

      StatefulRedisConnection<K,​V> getStatefulConnection()
      Returns:
      the underlying connection.