public class KeyValueSelectBucketHandler extends SimpleChannelInboundHandler<FullBinaryMemcacheResponse> implements ChannelOutboundHandler
A Select bucket handler required for Spock cluster
ChannelHandler.Sharable
Constructor and Description |
---|
KeyValueSelectBucketHandler(String bucket)
Creates a new
KeyValueSelectBucketHandler . |
acceptInboundMessage, channelRead
channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionCaught, handlerAdded, handlerRemoved
public KeyValueSelectBucketHandler(String bucket)
Creates a new KeyValueSelectBucketHandler
.
bucket
- the name of the user/bucket.public void channelActive(ChannelHandlerContext ctx) throws Exception
Once the channel is marked as active, select bucket command is sent if the HELLO request has SELECT_BUCKET feature enabled.
channelActive
in interface ChannelInboundHandler
channelActive
in class ChannelInboundHandlerAdapter
ctx
- the handler context.Exception
- if something goes wrong during communicating to the server.protected void channelRead0(ChannelHandlerContext ctx, FullBinaryMemcacheResponse msg) throws Exception
Handles incoming Select bucket responses.
channelRead0
in class SimpleChannelInboundHandler<FullBinaryMemcacheResponse>
ctx
- the handler context.msg
- the incoming message to investigate.Exception
- if something goes wrong during communicating to the server.public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception
userEventTriggered
in interface ChannelInboundHandler
userEventTriggered
in class ChannelInboundHandlerAdapter
Exception
public void bind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise) throws Exception
bind
in interface ChannelOutboundHandler
Exception
public void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) throws Exception
connect
in interface ChannelOutboundHandler
Exception
public void disconnect(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception
disconnect
in interface ChannelOutboundHandler
Exception
public void close(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception
close
in interface ChannelOutboundHandler
Exception
public void deregister(ChannelHandlerContext ctx, ChannelPromise promise) throws Exception
deregister
in interface ChannelOutboundHandler
Exception
public void read(ChannelHandlerContext ctx) throws Exception
read
in interface ChannelOutboundHandler
Exception
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception
write
in interface ChannelOutboundHandler
Exception
public void flush(ChannelHandlerContext ctx) throws Exception
flush
in interface ChannelOutboundHandler
Exception
Copyright © 2018 Couchbase, Inc.. All rights reserved.