Class KeyValueMessageHandler
java.lang.Object
com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerAdapter
com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
com.couchbase.client.core.io.netty.kv.KeyValueMessageHandler
- All Implemented Interfaces:
com.couchbase.client.core.deps.io.netty.channel.ChannelHandler
,com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
,com.couchbase.client.core.deps.io.netty.channel.ChannelOutboundHandler
public class KeyValueMessageHandler
extends com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
This handler is responsible for writing KV requests and completing their associated responses
once they arrive.
- Since:
- 2.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.couchbase.client.core.deps.io.netty.channel.ChannelHandler
com.couchbase.client.core.deps.io.netty.channel.ChannelHandler.Sharable
-
Constructor Summary
ConstructorDescriptionKeyValueMessageHandler
(BaseEndpoint endpoint, EndpointContext endpointContext, Optional<String> bucketName) Creates a newKeyValueMessageHandler
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
channelActive
(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx) Actions to be performed when the channel becomes active.void
channelInactive
(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx) void
channelRead
(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object msg) void
write
(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object msg, com.couchbase.client.core.deps.io.netty.channel.ChannelPromise promise) Methods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
bind, close, connect, deregister, disconnect, flush, read
Methods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
Methods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerAdapter
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.couchbase.client.core.deps.io.netty.channel.ChannelHandler
handlerAdded, handlerRemoved
-
Constructor Details
-
KeyValueMessageHandler
public KeyValueMessageHandler(BaseEndpoint endpoint, EndpointContext endpointContext, Optional<String> bucketName) Creates a newKeyValueMessageHandler
.- Parameters:
endpointContext
- the parent core context.
-
-
Method Details
-
channelActive
public void channelActive(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx) Actions to be performed when the channel becomes active.Since the opaque is incremented in the handler below during bootstrap but now is only modified in this handler, cache the reference since the attribute lookup is more costly.
- Specified by:
channelActive
in interfacecom.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
- Overrides:
channelActive
in classcom.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
- Parameters:
ctx
- the channel context.
-
write
public void write(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object msg, com.couchbase.client.core.deps.io.netty.channel.ChannelPromise promise) - Specified by:
write
in interfacecom.couchbase.client.core.deps.io.netty.channel.ChannelOutboundHandler
- Overrides:
write
in classcom.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
-
channelRead
public void channelRead(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object msg) - Specified by:
channelRead
in interfacecom.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
- Overrides:
channelRead
in classcom.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
-
channelInactive
public void channelInactive(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx) - Specified by:
channelInactive
in interfacecom.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
- Overrides:
channelInactive
in classcom.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
-