public class HttpServerUpgradeHandler extends HttpObjectAggregator
| Modifier and Type | Class and Description |
|---|---|
static interface |
HttpServerUpgradeHandler.SourceCodec
The source codec that is used in the pipeline initially.
|
static interface |
HttpServerUpgradeHandler.UpgradeCodec
A codec that the source can be upgraded to.
|
static interface |
HttpServerUpgradeHandler.UpgradeCodecFactory
Creates a new
HttpServerUpgradeHandler.UpgradeCodec for the requested protocol name. |
static class |
HttpServerUpgradeHandler.UpgradeEvent
User event that is fired to notify about the completion of an HTTP upgrade
to another protocol.
|
| Constructor and Description |
|---|
HttpServerUpgradeHandler(HttpServerUpgradeHandler.SourceCodec sourceCodec,
HttpServerUpgradeHandler.UpgradeCodecFactory upgradeCodecFactory)
Constructs the upgrader with the supported codecs.
|
HttpServerUpgradeHandler(HttpServerUpgradeHandler.SourceCodec sourceCodec,
HttpServerUpgradeHandler.UpgradeCodecFactory upgradeCodecFactory,
int maxContentLength)
Constructs the upgrader with the supported codecs.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
decode(io.netty.channel.ChannelHandlerContext ctx,
HttpObject msg,
List<Object> out) |
aggregate, beginAggregation, closeAfterContinueResponse, finishAggregation, handleOversizedMessage, ignoreContentAfterContinueResponse, isAggregated, isContentLengthInvalid, isContentMessage, isLastContentMessage, isStartMessage, newContinueResponseacceptInboundMessage, channelInactive, ctx, handlerAdded, handlerRemoved, isHandlingOversizedMessage, maxContentLength, maxCumulationBufferComponents, setMaxCumulationBufferComponentspublic HttpServerUpgradeHandler(HttpServerUpgradeHandler.SourceCodec sourceCodec, HttpServerUpgradeHandler.UpgradeCodecFactory upgradeCodecFactory)
The handler instantiated by this constructor will reject an upgrade request with non-empty content.
It should not be a concern because an upgrade request is most likely a GET request.
If you have a client that sends a non-GET upgrade request, please consider using
HttpServerUpgradeHandler(SourceCodec, UpgradeCodecFactory, int) to specify the maximum
length of the content of an upgrade request.
sourceCodec - the codec that is being used initiallyupgradeCodecFactory - the factory that creates a new upgrade codec
for one of the requested upgrade protocolspublic HttpServerUpgradeHandler(HttpServerUpgradeHandler.SourceCodec sourceCodec, HttpServerUpgradeHandler.UpgradeCodecFactory upgradeCodecFactory, int maxContentLength)
sourceCodec - the codec that is being used initiallyupgradeCodecFactory - the factory that creates a new upgrade codec
for one of the requested upgrade protocolsmaxContentLength - the maximum length of the content of an upgrade requestprotected void decode(io.netty.channel.ChannelHandlerContext ctx,
HttpObject msg,
List<Object> out)
throws Exception
decode in class io.netty.handler.codec.MessageAggregator<HttpObject,HttpMessage,HttpContent,FullHttpMessage>ExceptionCopyright © 2008–2017 The Netty Project. All rights reserved.