public class PgsqlRawPartAccumulator extends MessageAccumulator<PgsqlRawPart,PgsqlRawHeader,PgsqlRawContent,MutablePgsqlRawMessage>
| Constructor and Description |
|---|
PgsqlRawPartAccumulator(int... types) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptInboundMessage(Object msg) |
protected void |
aggregate(MutablePgsqlRawMessage msg,
PgsqlRawContent part)
Transfers the information provided by the specified content message to the specified aggregated message.
|
protected MutablePgsqlRawMessage |
beginAggregation(PgsqlRawHeader start,
io.netty.buffer.ByteBuf bytes)
Creates a new aggregated message from the specified start message and the specified content.
|
protected boolean |
closeAfterContinueResponse(Object msg)
Determine if the channel should be closed after the result of
#newContinueResponse(Object) is written. |
protected void |
finishAggregation(MutablePgsqlRawMessage msg)
Invoked when the specified
aggregated message is about to be passed to the next handler in the pipeline. |
protected boolean |
ignoreContentAfterContinueResponse(Object msg)
Determine if all objects for the current request/response should be ignored or not.
|
protected boolean |
isAggregated(PgsqlRawPart msg)
Returns
true if and only if the specified message is already aggregated. |
protected boolean |
isContentLengthInvalid(PgsqlRawHeader start,
int maxContentLength)
Determine if the message
start's content length is known, and if it greater than
maxContentLength. |
protected boolean |
isContentMessage(PgsqlRawPart msg)
Returns
true if and only if the specified message is a content message. |
protected boolean |
isLastContentMessage(PgsqlRawContent msg)
Returns
true if and only if the specified message is the last content message. |
protected boolean |
isStartMessage(PgsqlRawPart msg)
Returns
true if and only if the specified message is a start message. |
protected Object |
newContinueResponse(PgsqlRawHeader start,
int maxContentLength,
io.netty.channel.ChannelPipeline pipeline)
Returns the 'continue response' for the specified start message if necessary.
|
channelInactive, ctx, decode, handleOversizedMessage, handlerAdded, handlerRemoved, isHandlingOversizedMessage, maxContentLength, maxCumulationBufferComponents, setMaxCumulationBufferComponentspublic boolean acceptInboundMessage(Object msg) throws Exception
acceptInboundMessage in class MessageAccumulator<PgsqlRawPart,PgsqlRawHeader,PgsqlRawContent,MutablePgsqlRawMessage>Exceptionprotected boolean isStartMessage(PgsqlRawPart msg) throws Exception
MessageAccumulatortrue if and only if the specified message is a start message. Typically, this method is
implemented as a single return statement with instanceof:
return msg instanceof MyStartMessage;
isStartMessage in class MessageAccumulator<PgsqlRawPart,PgsqlRawHeader,PgsqlRawContent,MutablePgsqlRawMessage>Exceptionprotected boolean isContentMessage(PgsqlRawPart msg) throws Exception
MessageAccumulatortrue if and only if the specified message is a content message. Typically, this method is
implemented as a single return statement with instanceof:
return msg instanceof MyContentMessage;
isContentMessage in class MessageAccumulator<PgsqlRawPart,PgsqlRawHeader,PgsqlRawContent,MutablePgsqlRawMessage>Exceptionprotected boolean isLastContentMessage(PgsqlRawContent msg) throws Exception
MessageAccumulatortrue if and only if the specified message is the last content message. Typically, this method is
implemented as a single return statement with instanceof:
return msg instanceof MyLastContentMessage;or with
instanceof and boolean field check:
return msg instanceof MyContentMessage && msg.isLastFragment();
isLastContentMessage in class MessageAccumulator<PgsqlRawPart,PgsqlRawHeader,PgsqlRawContent,MutablePgsqlRawMessage>Exceptionprotected boolean isAggregated(PgsqlRawPart msg) throws Exception
MessageAccumulatortrue if and only if the specified message is already aggregated. If this method returns
true, this handler will simply forward the message to the next handler as-is.isAggregated in class MessageAccumulator<PgsqlRawPart,PgsqlRawHeader,PgsqlRawContent,MutablePgsqlRawMessage>Exceptionprotected boolean isContentLengthInvalid(PgsqlRawHeader start, int maxContentLength) throws Exception
MessageAccumulatorstart's content length is known, and if it greater than
maxContentLength.isContentLengthInvalid in class MessageAccumulator<PgsqlRawPart,PgsqlRawHeader,PgsqlRawContent,MutablePgsqlRawMessage>start - The message which may indicate the content length.maxContentLength - The maximum allowed content length.true if the message start's content length is known, and if it greater than
maxContentLength. false otherwise.Exceptionprotected Object newContinueResponse(PgsqlRawHeader start, int maxContentLength, io.netty.channel.ChannelPipeline pipeline) throws Exception
MessageAccumulatornewContinueResponse in class MessageAccumulator<PgsqlRawPart,PgsqlRawHeader,PgsqlRawContent,MutablePgsqlRawMessage>null if there's no message to sendExceptionprotected boolean closeAfterContinueResponse(Object msg) throws Exception
MessageAccumulator#newContinueResponse(Object) is written.closeAfterContinueResponse in class MessageAccumulator<PgsqlRawPart,PgsqlRawHeader,PgsqlRawContent,MutablePgsqlRawMessage>msg - The return value from #newContinueResponse(Object).true if the channel should be closed after the result of #newContinueResponse(Object)
is written. false otherwise.Exceptionprotected boolean ignoreContentAfterContinueResponse(Object msg) throws Exception
MessageAccumulatorMessageAccumulator.isContentMessage(Object) returns true.ignoreContentAfterContinueResponse in class MessageAccumulator<PgsqlRawPart,PgsqlRawHeader,PgsqlRawContent,MutablePgsqlRawMessage>msg - The return value from #newContinueResponse(Object).true if all objects for the current request/response should be ignored or not.
false otherwise.Exceptionprotected MutablePgsqlRawMessage beginAggregation(PgsqlRawHeader start, io.netty.buffer.ByteBuf bytes) throws Exception
MessageAccumulatorByteBufHolder, its content is appended to the specified content.
This aggregator will continue to append the received content to the specified content.beginAggregation in class MessageAccumulator<PgsqlRawPart,PgsqlRawHeader,PgsqlRawContent,MutablePgsqlRawMessage>Exceptionprotected void aggregate(MutablePgsqlRawMessage msg, PgsqlRawContent part) throws Exception
MessageAccumulatoraggregated.aggregate in class MessageAccumulator<PgsqlRawPart,PgsqlRawHeader,PgsqlRawContent,MutablePgsqlRawMessage>Exceptionprotected void finishAggregation(MutablePgsqlRawMessage msg) throws Exception
MessageAccumulatoraggregated message is about to be passed to the next handler in the pipeline.finishAggregation in class MessageAccumulator<PgsqlRawPart,PgsqlRawHeader,PgsqlRawContent,MutablePgsqlRawMessage>ExceptionCopyright © 2017 The CLARUS Consortium. All rights reserved.