java.lang.Object
io.netty.channel.ChannelHandlerAdapter
io.netty.channel.ChannelInboundHandlerAdapter
io.lettuce.core.protocol.RedisHandshakeHandler
- All Implemented Interfaces:
ChannelHandler,ChannelInboundHandler
public class RedisHandshakeHandler extends ChannelInboundHandlerAdapter
Handler to initialize a Redis Connection using a
ConnectionInitializer.- Since:
- 6.0
- Author:
- Mark Paluch
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler
ChannelHandler.Sharable -
Constructor Summary
Constructors Constructor Description RedisHandshakeHandler(ConnectionInitializer connectionInitializer, ClientResources clientResources, Duration initializeTimeout) -
Method Summary
Modifier and Type Method Description voidchannelActive(ChannelHandlerContext ctx)voidchannelInactive(ChannelHandlerContext ctx)CompletionStage<Void>channelInitialized()voidchannelRegistered(ChannelHandlerContext ctx)voidexceptionCaught(ChannelHandlerContext ctx, Throwable cause)protected voidfail(ChannelHandlerContext ctx, Throwable cause)Complete the handshake future with an error and close the channel..protected voidsucceed()Complete the handshake future successfully.Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter
channelRead, channelReadComplete, channelUnregistered, channelWritabilityChanged, userEventTriggeredMethods inherited from class io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharableMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
RedisHandshakeHandler
public RedisHandshakeHandler(ConnectionInitializer connectionInitializer, ClientResources clientResources, Duration initializeTimeout)
-
-
Method Details
-
channelRegistered
- Specified by:
channelRegisteredin interfaceChannelInboundHandler- Overrides:
channelRegisteredin classChannelInboundHandlerAdapter- Throws:
Exception
-
channelInactive
- Specified by:
channelInactivein interfaceChannelInboundHandler- Overrides:
channelInactivein classChannelInboundHandlerAdapter- Throws:
Exception
-
channelActive
- Specified by:
channelActivein interfaceChannelInboundHandler- Overrides:
channelActivein classChannelInboundHandlerAdapter
-
exceptionCaught
- Specified by:
exceptionCaughtin interfaceChannelHandler- Specified by:
exceptionCaughtin interfaceChannelInboundHandler- Overrides:
exceptionCaughtin classChannelInboundHandlerAdapter- Throws:
Exception
-
succeed
protected void succeed()Complete the handshake future successfully. -
fail
Complete the handshake future with an error and close the channel.. -
channelInitialized
- Returns:
- future to synchronize channel initialization. Returns a new future for every reconnect.
-