Class SelectBucketHandler

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.SelectBucketHandler
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

@Internal public class SelectBucketHandler extends com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
The SelectBucketHandler is responsible for, selecting the right bucket on this KV connection.

The reason this handler is in place that since Server 5.0 and RBAC (role based access control) one user after SASL/cert auth can have credentials for more than one bucket. To signal the server which bucket it should select, this command is used as usually the last step in the pipeline.

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
    SelectBucketHandler(EndpointContext endpointContext, String bucketName)
    Creates a new SelectBucketHandler.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    channelActive(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
    connect(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, 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, deregister, disconnect, flush, read, write

    Methods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter

    channelInactive, 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

    • SelectBucketHandler

      public SelectBucketHandler(EndpointContext endpointContext, String bucketName)
      Creates a new SelectBucketHandler.
      Parameters:
      endpointContext - the core context used to refer to values like the core id.
      bucketName - the bucket name to select.
  • Method Details

    • connect

      public void connect(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, com.couchbase.client.core.deps.io.netty.channel.ChannelPromise promise)
      Specified by:
      connect in interface com.couchbase.client.core.deps.io.netty.channel.ChannelOutboundHandler
      Overrides:
      connect in class com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
    • channelActive

      public void channelActive(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx)
      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
    • 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