class StatefulRedisSentinelConnectionImpl<K, V> extends RedisChannelHandler<K, V>
        implements StatefulRedisSentinelConnection<K, V> {

    protected final RedisCodec<K, V> codec;

    protected final RedisSentinelCommands<K, V> sync;

    protected final RedisSentinelAsyncCommands<K, V> async;

    protected final RedisSentinelReactiveCommands<K, V> reactive;

    private final SentinelConnectionState connectionState = new SentinelConnectionState();

    public StatefulRedisSentinelConnectionImpl(RedisChannelWriter writer, RedisCodec<K, V> codec, Duration timeout) {

        super(writer, timeout);

        this.codec = codec;
        this.async = new RedisSentinelAsyncCommandsImpl<>(this, codec);
        this.sync = syncHandler(async, RedisSentinelCommands.class);
        this.reactive = new RedisSentinelReactiveCommandsImpl<>(this, codec);
    }

    @Override
    public <T> RedisCommand<K, V, T> dispatch(RedisCommand<K, V, T> command) {
        return super.dispatch(command);
    }

    @Override
    public Collection<RedisCommand<K, V, ?>> dispatch(Collection<? extends RedisCommand<K, V, ?>> commands) {
        return super.dispatch(commands);
    }

    @Override
    public RedisSentinelCommands<K, V> sync() {
        return sync;
    }

    @Override
    public RedisSentinelAsyncCommands<K, V> async() {
        return async;
    }

    @Override
    public RedisSentinelReactiveCommands<K, V> reactive() {
        return reactive;
    }

    /**
     * @param clientName
     * @deprecated since 6.0, use {@link RedisSentinelAsyncCommands#clientSetname(Object)}.
     */
    @Deprecated
    public void setClientName(String clientName) {<FILL_FUNCTION_BODY>}

    public ConnectionState getConnectionState() {
        return connectionState;
    }

    static class SentinelConnectionState extends ConnectionState {

        @Override
        protected void setClientName(String clientName) {
            super.setClientName(clientName);
        }

    }

}


        CommandArgs<String, String> args = new CommandArgs<>(StringCodec.UTF8).add(CommandKeyword.SETNAME).addValue(clientName);
        AsyncCommand<String, String, String> async = new AsyncCommand<>(
                new Command<>(CommandType.CLIENT, new StatusOutput<>(StringCodec.UTF8), args));
        connectionState.setClientName(clientName);

        dispatch((RedisCommand) async);
    
<methods>public void <init>(io.lettuce.core.RedisChannelWriter, java.time.Duration) ,public void activated() ,public void addListener(io.lettuce.core.RedisConnectionStateListener) ,public void close() ,public CompletableFuture<java.lang.Void> closeAsync() ,public void deactivated() ,public void flushCommands() ,public io.lettuce.core.RedisChannelWriter getChannelWriter() ,public io.lettuce.core.ConnectionEvents getConnectionEvents() ,public io.lettuce.core.ClientOptions getOptions() ,public io.lettuce.core.resource.ClientResources getResources() ,public java.time.Duration getTimeout() ,public boolean isClosed() ,public boolean isOpen() ,public transient void registerCloseables(Collection<java.io.Closeable>, java.io.Closeable[]) ,public void removeListener(io.lettuce.core.RedisConnectionStateListener) ,public void reset() ,public void setAutoFlushCommands(boolean) ,public void setOptions(io.lettuce.core.ClientOptions) ,public void setTimeout(java.time.Duration) <variables>private static final AtomicIntegerFieldUpdater<RedisChannelHandler#RAW> CLOSED,private static final int ST_CLOSED,private static final int ST_OPEN,private volatile boolean active,private final non-sealed io.lettuce.core.RedisChannelWriter channelWriter,private volatile io.lettuce.core.ClientOptions clientOptions,private final non-sealed io.lettuce.core.resource.ClientResources clientResources,private io.lettuce.core.CloseEvents closeEvents,private final CompletableFuture<java.lang.Void> closeFuture,private volatile int closed,private final io.lettuce.core.ConnectionEvents connectionEvents,private final boolean debugEnabled,private static final InternalLogger logger,private java.time.Duration timeout,private final non-sealed boolean tracingEnabled