public class QueryHandlerV2 extends AbstractGenericHandler<HttpObject,HttpRequest,QueryRequest>
The QueryHandlerV2 is responsible for encoding QueryRequests into lower level HttpRequests as well as decoding HttpObjects into CouchbaseResponses. The query response parser uses YasjlQueryResponseParser
| Modifier and Type | Class and Description |
|---|---|
protected static class |
QueryHandlerV2.KeepAliveRequest |
protected static class |
QueryHandlerV2.KeepAliveResponse |
ChannelHandler.SharableCHARSET, EMPTY_BYTES| Constructor and Description |
|---|
QueryHandlerV2(AbstractEndpoint endpoint,
com.lmax.disruptor.RingBuffer<ResponseEvent> responseBuffer,
boolean isTransient,
boolean pipeline)
Creates a new
QueryHandlerV2 with the default queue for requests. |
| Modifier and Type | Method and Description |
|---|---|
protected CouchbaseRequest |
createKeepAliveRequest()
Override to return a non-null request to be fired in the pipeline in case a keep alive is triggered.
|
protected CouchbaseResponse |
decodeResponse(ChannelHandlerContext ctx,
HttpObject msg)
Decodes the incoming response and transforms it into a
CouchbaseResponse. |
protected HttpRequest |
encodeRequest(ChannelHandlerContext ctx,
QueryRequest msg)
Encode the outgoing request and return it in encoded format.
|
protected void |
finishedDecoding()
Notify that decoding is finished.
|
void |
handlerRemoved(ChannelHandlerContext ctx) |
protected ServiceType |
serviceType()
Returns the
ServiceType associated with this handler. |
addHttpBasicAuth, channelActive, channelInactive, channelWritabilityChanged, connect, currentRequest, currentRequest, decode, encode, endpoint, env, exceptionCaught, getDecodingState, logIdent, onKeepAliveFired, onKeepAliveResponse, publishResponse, remoteHostname, remoteHttpHost, sideEffectRequestToCancel, userEventTriggered, writeacceptInboundMessage, acceptOutboundMessage, channelReadbind, close, deregister, disconnect, flush, readchannelReadComplete, channelRegistered, channelUnregisteredensureNotSharable, handlerAdded, isSharableclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waithandlerAddedpublic QueryHandlerV2(AbstractEndpoint endpoint, com.lmax.disruptor.RingBuffer<ResponseEvent> responseBuffer, boolean isTransient, boolean pipeline)
Creates a new QueryHandlerV2 with the default queue for requests.
endpoint - the AbstractEndpoint to coordinate with.responseBuffer - the RingBuffer to push responses into.protected HttpRequest encodeRequest(ChannelHandlerContext ctx, QueryRequest msg) throws Exception
AbstractGenericHandlerEncode 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<HttpObject,HttpRequest,QueryRequest>ctx - the context passed in.msg - the outgoing message.Exception - as a generic error.protected CouchbaseResponse decodeResponse(ChannelHandlerContext ctx, HttpObject msg) throws Exception
AbstractGenericHandlerDecodes 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<HttpObject,HttpRequest,QueryRequest>ctx - the context passed in.msg - the incoming message.Exception - as a generic error. It will be bubbled up to the user (wrapped in a CouchbaseException) in the onError of the request’s Observable.protected void finishedDecoding()
AbstractGenericHandlerNotify that decoding is finished. This needs to be called by the child handlers in order to signal that operations are done.
finishedDecoding in class AbstractGenericHandler<HttpObject,HttpRequest,QueryRequest>public void handlerRemoved(ChannelHandlerContext ctx) throws Exception
handlerRemoved in interface ChannelHandlerhandlerRemoved in class AbstractGenericHandler<HttpObject,HttpRequest,QueryRequest>Exceptionprotected CouchbaseRequest createKeepAliveRequest()
AbstractGenericHandlerOverride to return a non-null request to be fired in the pipeline in case a keep alive is triggered.
createKeepAliveRequest in class AbstractGenericHandler<HttpObject,HttpRequest,QueryRequest>protected ServiceType serviceType()
AbstractGenericHandlerReturns the ServiceType associated with this handler.
serviceType in class AbstractGenericHandler<HttpObject,HttpRequest,QueryRequest>Copyright © 2017 Couchbase, Inc.. All rights reserved.