@UnstableApi public final class RedisBulkStringAggregator extends io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>
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
:
Be aware that you need to have theChannelPipeline
p = ...; ... p.addLast("encoder", newRedisEncoder
()); p.addLast("decoder", newRedisDecoder
()); p.addLast("aggregator", newRedisBulkStringAggregator
()); ... p.addLast("handler", new HttpRequestHandler());
RedisEncoder
before the RedisBulkStringAggregator
in the ChannelPipeline
.Constructor and Description |
---|
RedisBulkStringAggregator()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
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) |
acceptInboundMessage, aggregate, channelInactive, channelReadComplete, ctx, decode, finishAggregation, handleOversizedMessage, handlerAdded, handlerRemoved, isHandlingOversizedMessage, maxContentLength, maxCumulationBufferComponents, setMaxCumulationBufferComponents
public RedisBulkStringAggregator()
protected boolean isStartMessage(RedisMessage msg) throws Exception
isStartMessage
in class io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>
Exception
protected boolean isContentMessage(RedisMessage msg) throws Exception
isContentMessage
in class io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>
Exception
protected boolean isLastContentMessage(BulkStringRedisContent msg) throws Exception
isLastContentMessage
in class io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>
Exception
protected boolean isAggregated(RedisMessage msg) throws Exception
isAggregated
in class io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>
Exception
protected boolean isContentLengthInvalid(BulkStringHeaderRedisMessage start, int maxContentLength) throws Exception
isContentLengthInvalid
in class io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>
Exception
protected Object newContinueResponse(BulkStringHeaderRedisMessage start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline) throws Exception
newContinueResponse
in class io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>
Exception
protected boolean closeAfterContinueResponse(Object msg) throws Exception
closeAfterContinueResponse
in class io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>
Exception
protected boolean ignoreContentAfterContinueResponse(Object msg) throws Exception
ignoreContentAfterContinueResponse
in class io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>
Exception
protected FullBulkStringRedisMessage beginAggregation(BulkStringHeaderRedisMessage start, io.netty.buffer.ByteBuf content) throws Exception
beginAggregation
in class io.netty.handler.codec.MessageAggregator<RedisMessage,BulkStringHeaderRedisMessage,BulkStringRedisContent,FullBulkStringRedisMessage>
Exception
Copyright © 2008–2020 The Netty Project. All rights reserved.