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

    Constructors
    Constructor
    Description
    KeyValueMessageHandler(BaseEndpoint endpoint, EndpointContext endpointContext, Optional<String> bucketName)
    Creates a new KeyValueMessageHandler.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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

  • 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 interface com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
      Overrides:
      channelActive in class com.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 interface com.couchbase.client.core.deps.io.netty.channel.ChannelOutboundHandler
      Overrides:
      write in class com.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 interface com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
      Overrides:
      channelRead in class com.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 interface com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
      Overrides:
      channelInactive in class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter