public class KeyValueFeatureHandler extends SimpleChannelInboundHandler<FullBinaryMemcacheResponse> implements ChannelOutboundHandler
This handler negotiates the enabled features through the HELLO command.
Like the SASL auth handler, this handler intercepts the original connect process to properly negotiate the supported features with the server. Once the features are negotiated they are sent through custom events up the pipeline and the handler removes itself.
ChannelHandler.Sharable
Constructor and Description |
---|
KeyValueFeatureHandler(CoreContext ctx) |
Modifier and Type | Method and Description |
---|---|
void |
bind(ChannelHandlerContext ctx,
SocketAddress localAddress,
ChannelPromise promise) |
void |
channelActive(ChannelHandlerContext ctx) |
protected void |
channelRead0(ChannelHandlerContext ctx,
FullBinaryMemcacheResponse msg) |
void |
close(ChannelHandlerContext ctx,
ChannelPromise promise) |
void |
connect(ChannelHandlerContext ctx,
SocketAddress remoteAddress,
SocketAddress localAddress,
ChannelPromise promise) |
void |
deregister(ChannelHandlerContext ctx,
ChannelPromise promise) |
void |
disconnect(ChannelHandlerContext ctx,
ChannelPromise promise) |
void |
flush(ChannelHandlerContext ctx) |
static String |
paddedHex(long number)
Helper method to create a padded hex long value.
|
void |
read(ChannelHandlerContext ctx) |
void |
write(ChannelHandlerContext ctx,
Object msg,
ChannelPromise promise) |
acceptInboundMessage, channelRead
channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
ensureNotSharable, handlerAdded, handlerRemoved, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
exceptionCaught, handlerAdded, handlerRemoved
public KeyValueFeatureHandler(CoreContext ctx)
protected void channelRead0(ChannelHandlerContext ctx, FullBinaryMemcacheResponse msg) throws Exception
channelRead0
in class SimpleChannelInboundHandler<FullBinaryMemcacheResponse>
Exception
public void channelActive(ChannelHandlerContext ctx) throws Exception
channelActive
in interface ChannelInboundHandler
channelActive
in class ChannelInboundHandlerAdapter
Exception
public static String paddedHex(long number)
Helper method to create a padded hex long value.
number
- number to pad.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
public void bind(ChannelHandlerContext ctx, SocketAddress localAddress, ChannelPromise promise) throws Exception
bind
in interface ChannelOutboundHandler
Exception
Copyright © 2018 Couchbase, Inc.. All rights reserved.