io.netty.handler.codec.redis

## Class RedisBulkStringAggregator

- java.lang.Object
- - io.netty.channel.ChannelHandlerAdapter
  - - io.netty.channel.ChannelInboundHandlerAdapter
    - - io.netty.handler.codec.MessageToMessageDecoder<I>
      - - io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>
        - - io.netty.handler.codec.redis.RedisBulkStringAggregator

All Implemented Interfaces:
  io.netty.channel.ChannelHandler, io.netty.channel.ChannelInboundHandler

    @UnstableApi
    public final class RedisBulkStringAggregator
    extends io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>

A `ChannelHandler` that aggregates an `BulkStringHeaderRedisMessage` and its following `BulkStringRedisContent`s into a single `FullBulkStringRedisMessage` with no following `BulkStringRedisContent`s. It is useful when you don't want to take care of `RedisMessage`s whose transfer encoding is 'chunked'. Insert this handler after `RedisDecoder` in the `ChannelPipeline`:

     ChannelPipeline p = ...;
     ...
     p.addLast("encoder", new RedisEncoder());
     p.addLast("decoder", new RedisDecoder());
     p.addLast("aggregator", new RedisBulkStringAggregator());
     ...
     p.addLast("handler", new HttpRequestHandler());

Be aware that you need to have the `RedisEncoder` before the `RedisBulkStringAggregator` in the `ChannelPipeline`.

### Nested Class Summary

### Nested classes/interfaces inherited from interface io.netty.channel.ChannelHandler

`io.netty.channel.ChannelHandler.Sharable`

### Constructor Summary

Constructors
Constructor and Description
`RedisBulkStringAggregator()` Creates a new instance.

### Method Summary

All Methods Instance Methods Concrete Methods
`protected FullBulkStringRedisMessage` `beginAggregation(BulkStringHeaderRedisMessage start, io.netty.buffer.ByteBuf content)`
`protected boolean` `closeAfterContinueResponse(Object msg)`
`protected boolean` `ignoreContentAfterContinueResponse(Object msg)`
`protected boolean` `isAggregated(RedisMessage msg)`
`protected boolean` `isContentLengthInvalid(BulkStringHeaderRedisMessage start, int maxContentLength)`
`protected boolean` `isContentMessage(RedisMessage msg)`
`protected boolean` `isLastContentMessage(BulkStringRedisContent msg)`
`protected boolean` `isStartMessage(RedisMessage msg)`
`protected Object` `newContinueResponse(BulkStringHeaderRedisMessage start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline)`

### Methods inherited from class io.netty.handler.codec.MessageAggregator

`acceptInboundMessage, aggregate, channelInactive, channelReadComplete, ctx, decode, finishAggregation, handleOversizedMessage, handlerAdded, handlerRemoved, isHandlingOversizedMessage, maxContentLength, maxCumulationBufferComponents, setMaxCumulationBufferComponents`

### Methods inherited from class io.netty.handler.codec.MessageToMessageDecoder

`channelRead`

### Methods inherited from class io.netty.channel.ChannelInboundHandlerAdapter

`channelActive, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered`

### Methods inherited from class io.netty.channel.ChannelHandlerAdapter

`ensureNotSharable, isSharable`

### Methods inherited from class java.lang.Object

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

### Constructor Detail

#### RedisBulkStringAggregator

    public RedisBulkStringAggregator()

Creates a new instance.

### Method Detail

#### isStartMessage

    protected boolean isStartMessage(RedisMessage msg)
                              throws Exception

Specified by:
  `isStartMessage` in class `io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>`
Throws:
  `Exception`

#### isContentMessage

    protected boolean isContentMessage(RedisMessage msg)
                                throws Exception

Specified by:
  `isContentMessage` in class `io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>`
Throws:
  `Exception`

#### isLastContentMessage

    protected boolean isLastContentMessage(BulkStringRedisContent msg)
                                    throws Exception

Specified by:
  `isLastContentMessage` in class `io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>`
Throws:
  `Exception`

#### isAggregated

    protected boolean isAggregated(RedisMessage msg)
                            throws Exception

Specified by:
  `isAggregated` in class `io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>`
Throws:
  `Exception`

#### isContentLengthInvalid

    protected boolean isContentLengthInvalid(BulkStringHeaderRedisMessage start,
                                             int maxContentLength)
                                      throws Exception

Specified by:
  `isContentLengthInvalid` in class `io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>`
Throws:
  `Exception`

#### newContinueResponse

    protected Object newContinueResponse(BulkStringHeaderRedisMessage start,
                                         int maxContentLength,
                                         io.netty.channel.ChannelPipeline pipeline)
                                  throws Exception

Specified by:
  `newContinueResponse` in class `io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>`
Throws:
  `Exception`

#### closeAfterContinueResponse

    protected boolean closeAfterContinueResponse(Object msg)
                                          throws Exception

Specified by:
  `closeAfterContinueResponse` in class `io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>`
Throws:
  `Exception`

#### ignoreContentAfterContinueResponse

    protected boolean ignoreContentAfterContinueResponse(Object msg)
                                                  throws Exception

Specified by:
  `ignoreContentAfterContinueResponse` in class `io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>`
Throws:
  `Exception`

#### beginAggregation

    protected FullBulkStringRedisMessage beginAggregation(BulkStringHeaderRedisMessage start,
                                                          io.netty.buffer.ByteBuf content)
                                                   throws Exception

Specified by:
  `beginAggregation` in class `io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>`
Throws:
  `Exception`