public class SearchHandler extends AbstractGenericHandler<HttpObject,HttpRequest,SearchRequest>
The SearchHandler
is responsible for encoding SearchRequest
s into lower level HttpRequest
s as well as decoding HttpObject
s into CouchbaseResponse
s.
ChannelHandler.Sharable
CHARSET, EMPTY_BYTES
Constructor and Description |
---|
SearchHandler(AbstractEndpoint endpoint,
com.lmax.disruptor.EventSink<ResponseEvent> responseBuffer,
boolean isTransient) |
Modifier and Type | Method and Description |
---|---|
protected CouchbaseResponse |
decodeResponse(ChannelHandlerContext ctx,
HttpObject msg)
Decodes the incoming response and transforms it into a
CouchbaseResponse . |
protected HttpRequest |
encodeRequest(ChannelHandlerContext ctx,
SearchRequest msg)
Encode the outgoing request and return it in encoded format.
|
protected ServiceType |
serviceType()
Returns the
ServiceType associated with this handler. |
addHttpBasicAuth, channelActive, channelInactive, channelWritabilityChanged, connect, createKeepAliveRequest, currentRequest, currentRequest, decode, encode, endpoint, env, exceptionCaught, finishedDecoding, getDecodingState, handlerRemoved, logIdent, onKeepAliveFired, onKeepAliveResponse, publishResponse, remoteHostname, remoteHttpHost, sideEffectRequestToCancel, userEventTriggered, write
acceptInboundMessage, acceptOutboundMessage, channelRead
bind, close, deregister, disconnect, flush, read
channelReadComplete, channelRegistered, channelUnregistered
handlerAdded, isSharable
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handlerAdded
public SearchHandler(AbstractEndpoint endpoint, com.lmax.disruptor.EventSink<ResponseEvent> responseBuffer, boolean isTransient)
protected HttpRequest encodeRequest(ChannelHandlerContext ctx, SearchRequest msg) throws 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<HttpObject,HttpRequest,SearchRequest>
ctx
- the context passed in.msg
- the outgoing message.Exception
- as a generic error.protected CouchbaseResponse decodeResponse(ChannelHandlerContext ctx, HttpObject msg) throws 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<HttpObject,HttpRequest,SearchRequest>
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 ServiceType serviceType()
AbstractGenericHandler
Returns the ServiceType
associated with this handler.
serviceType
in class AbstractGenericHandler<HttpObject,HttpRequest,SearchRequest>
Copyright © 2016 Couchbase, Inc.. All rights reserved.