Class ChunkedMessageHandler<H extends ChunkHeader,ROW extends ChunkRow,T extends ChunkTrailer,R extends ChunkedResponse<H,ROW,T>,REQ extends HttpRequest<H,ROW,T,R>>

java.lang.Object
com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerAdapter
com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
com.couchbase.client.core.io.netty.chunk.ChunkedMessageHandler<H,ROW,T,R,REQ>
All Implemented Interfaces:
com.couchbase.client.core.deps.io.netty.channel.ChannelHandler, com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler, com.couchbase.client.core.deps.io.netty.channel.ChannelOutboundHandler
Direct Known Subclasses:
AnalyticsMessageHandler, QueryMessageHandler

@Sharable public abstract class ChunkedMessageHandler<H extends ChunkHeader,ROW extends ChunkRow,T extends ChunkTrailer,R extends ChunkedResponse<H,ROW,T>,REQ extends HttpRequest<H,ROW,T,R>> extends com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
Implements the chunk stream handling for all generic http stream based services.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.couchbase.client.core.deps.io.netty.channel.ChannelHandler

    com.couchbase.client.core.deps.io.netty.channel.ChannelHandler.Sharable
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    ChunkedMessageHandler(BaseEndpoint endpoint, EndpointContext endpointContext, ChunkResponseParser<H,ROW,T> chunkResponseParser)
    Creates a new ChunkedMessageHandler.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    channelActive(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx)
     
    void
    channelInactive(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx)
     
    void
    channelRead(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object msg)
     
    void
    handlerRemoved(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx)
     
    Can be implemented by children to not fail a request but rather send it into retry.
    void
    write(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object msg, com.couchbase.client.core.deps.io.netty.channel.ChannelPromise promise)
     

    Methods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler

    bind, close, connect, deregister, disconnect, flush, read

    Methods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter

    channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered

    Methods inherited from class com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerAdapter

    ensureNotSharable, handlerAdded, isSharable

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.couchbase.client.core.deps.io.netty.channel.ChannelHandler

    handlerAdded
  • Constructor Details

    • ChunkedMessageHandler

      protected ChunkedMessageHandler(BaseEndpoint endpoint, EndpointContext endpointContext, ChunkResponseParser<H,ROW,T> chunkResponseParser)
      Creates a new ChunkedMessageHandler.
      Parameters:
      endpoint - holds the surrounding endpoint.
      endpointContext - the related endpoint context.
      chunkResponseParser - the chunk response parser to use for this handler.
  • Method Details

    • write

      public void write(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object msg, com.couchbase.client.core.deps.io.netty.channel.ChannelPromise promise)
      Specified by:
      write in interface com.couchbase.client.core.deps.io.netty.channel.ChannelOutboundHandler
      Overrides:
      write in class com.couchbase.client.core.deps.io.netty.channel.ChannelDuplexHandler
    • channelActive

      public void channelActive(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      channelActive in interface com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
      Overrides:
      channelActive in class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
    • channelRead

      public void channelRead(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx, Object msg)
      Specified by:
      channelRead in interface com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
      Overrides:
      channelRead in class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
    • handlerRemoved

      public void handlerRemoved(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      handlerRemoved in interface com.couchbase.client.core.deps.io.netty.channel.ChannelHandler
      Overrides:
      handlerRemoved in class com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerAdapter
    • channelInactive

      public void channelInactive(com.couchbase.client.core.deps.io.netty.channel.ChannelHandlerContext ctx)
      Specified by:
      channelInactive in interface com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandler
      Overrides:
      channelInactive in class com.couchbase.client.core.deps.io.netty.channel.ChannelInboundHandlerAdapter
    • qualifiesForRetry

      protected Optional<RetryReason> qualifiesForRetry(CouchbaseException exception)
      Can be implemented by children to not fail a request but rather send it into retry.
      Parameters:
      exception - the throwable to check.
      Returns:
      a reason if it should be retried - if empty will fail the request.