public class ConfigHandler extends AbstractGenericHandler<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpRequest,ConfigRequest>
The ConfigHandler
is responsible for encoding ConfigRequest
s into lower level HttpRequest
s as well as decoding HttpObject
s into CouchbaseResponse
s.
CHARSET
Constructor and Description |
---|
ConfigHandler(AbstractEndpoint endpoint,
com.lmax.disruptor.RingBuffer<ResponseEvent> responseBuffer)
Creates a new
ConfigHandler with the default queue for requests. |
Modifier and Type | Method and Description |
---|---|
protected CouchbaseResponse |
decodeResponse(io.netty.channel.ChannelHandlerContext ctx,
io.netty.handler.codec.http.HttpObject msg)
Decodes the incoming response and transforms it into a
CouchbaseResponse . |
protected io.netty.handler.codec.http.HttpRequest |
encodeRequest(io.netty.channel.ChannelHandlerContext ctx,
ConfigRequest msg)
Encode the outgoing request and return it in encoded format.
|
void |
handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) |
channelActive, channelInactive, channelWritabilityChanged, currentRequest, currentRequest, decode, encode, env, exceptionCaught, logIdent
acceptInboundMessage, acceptOutboundMessage, channelRead, write
bind, close, connect, deregister, disconnect, flush, read
channelReadComplete, channelRegistered, channelUnregistered, userEventTriggered
public ConfigHandler(AbstractEndpoint endpoint, com.lmax.disruptor.RingBuffer<ResponseEvent> responseBuffer)
Creates a new ConfigHandler
with the default queue for requests.
endpoint
- the AbstractEndpoint
to coordinate with.responseBuffer
- the RingBuffer
to push responses into.protected io.netty.handler.codec.http.HttpRequest encodeRequest(io.netty.channel.ChannelHandlerContext ctx, ConfigRequest msg) throws java.lang.Exception
AbstractGenericHandler
Encode the outgoing request and return it in encoded format.
This method needs to be implemented by the child handler and is responsible for the actual conversion.
encodeRequest
in class AbstractGenericHandler<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpRequest,ConfigRequest>
ctx
- the context passed in.msg
- the outgoing message.java.lang.Exception
- as a generic error.protected CouchbaseResponse decodeResponse(io.netty.channel.ChannelHandlerContext ctx, io.netty.handler.codec.http.HttpObject msg) throws java.lang.Exception
AbstractGenericHandler
Decodes the incoming response and transforms it into a CouchbaseResponse
.
Note that the actual notification is handled by this generic handler, the implementing class only is concerned about the conversion itself.
decodeResponse
in class AbstractGenericHandler<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpRequest,ConfigRequest>
ctx
- the context passed in.msg
- the incoming message.java.lang.Exception
- as a generic error.public void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) throws java.lang.Exception
handlerRemoved
in interface io.netty.channel.ChannelHandler
handlerRemoved
in class AbstractGenericHandler<io.netty.handler.codec.http.HttpObject,io.netty.handler.codec.http.HttpRequest,ConfigRequest>
java.lang.Exception