Class ConnectionState


  • public class ConnectionState
    extends Object
    Internal connection state representing the negotiated ProtocolVersion and other options for connection initialization and connection state restoration. This class is part of the internal API.
    Since:
    6.0
    Author:
    Mark Paluch, Jon Iantosca
    • Constructor Detail

      • ConnectionState

        public ConnectionState()
    • Method Detail

      • apply

        public void apply​(RedisURI redisURI)
        Applies settings from RedisURI.
        Parameters:
        redisURI - the URI to apply the client name and authentication.
      • getConnectionId

        public Long getConnectionId()
        Returns the client connection id. Only available when using ProtocolVersion.RESP3.
        Returns:
        the client connection id. Can be null if Redis uses RESP2.
      • getRedisVersion

        public String getRedisVersion()
        Returns the Redis server version. Only available when using ProtocolVersion.RESP3.
        Returns:
        the Redis server version.
      • getMode

        public String getMode()
        Returns the Redis server mode. Only available when using ProtocolVersion.RESP3.
        Returns:
        the Redis server mode.
      • getRole

        public String getRole()
        Returns the Redis server role. Only available when using ProtocolVersion.RESP3.
        Returns:
        the Redis server role.
      • setUserNamePassword

        protected void setUserNamePassword​(List<char[]> args)
        Sets username/password state based on the argument count from an AUTH command.
        Parameters:
        args -
      • setDb

        protected void setDb​(int db)
      • setReadOnly

        protected void setReadOnly​(boolean readOnly)
      • setClientName

        protected void setClientName​(String clientName)