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