| Modifier and Type | Class and Description |
|---|---|
| public static interface | HttpServerUpgradeHandler.SourceCodec
The source codec that is used in the pipeline initially. |
| public static interface | HttpServerUpgradeHandler.UpgradeCodec
A codec that the source can be upgraded to. |
| public static interface | HttpServerUpgradeHandler.UpgradeCodecFactory
Creates a new |
| public static class | HttpServerUpgradeHandler.UpgradeEvent
User event that is fired to notify about the completion of an HTTP upgrade to another protocol. |
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private final HttpHeadersFactory | |
| private final HttpServerUpgradeHandler. | |
| private final HttpHeadersFactory | |
| private final HttpServerUpgradeHandler. |
| Access | Constructor and Description |
|---|---|
| public | HttpServerUpgradeHandler(HttpServerUpgradeHandler.
the codec that is being used initially sourceCodec,the factory that creates a new upgrade codec
for one of the requested upgrade protocols upgradeCodecFactoryConstructs the upgrader with the supported codecs. |
| public | HttpServerUpgradeHandler(HttpServerUpgradeHandler.
the codec that is being used initially sourceCodec,the factory that creates a new upgrade codec
for one of the requested upgrade protocols upgradeCodecFactory,the maximum length of the content of an upgrade request maxContentLength)Constructs the upgrader with the supported codecs. |
| public | HttpServerUpgradeHandler(HttpServerUpgradeHandler.
the codec that is being used initially sourceCodec,the factory that creates a new upgrade codec
for one of the requested upgrade protocols upgradeCodecFactory,the maximum length of the content of an upgrade request maxContentLength, boolean validate the header names and values of the upgrade response. validateHeaders)Constructs the upgrader with the supported codecs. |
| public | HttpServerUpgradeHandler(HttpServerUpgradeHandler.
the codec that is being used initially sourceCodec,the factory that creates a new upgrade codec
for one of the requested upgrade protocols upgradeCodecFactory,the maximum length of the content of an upgrade request maxContentLength, HttpHeadersFactory The headersFactory, HttpHeadersFactory HttpHeadersFactory to use for headers.
The recommended default factory is DefaultHttpHeadersFactory#headersFactory().The trailersFactory)HttpHeadersFactory to use for trailers.
The recommended default factory is DefaultHttpHeadersFactory#trailersFactory().Constructs the upgrader with the supported codecs. |
| Modifier and Type | Method and Description |
|---|---|
| private FullHttpResponse | createUpgradeResponse(CharSequence upgradeProtocol)
Creates the 101 Switching Protocols response message. |
| protected void | decode(ChannelHandlerContext
the ctx, HttpObject ChannelHandlerContext which this MessageToMessageDecoder belongs tothe message to decode to an other one msg, List<Object> the out)
Decode from one message to an other.
List to which decoded messages should be added |
| protected boolean | shouldHandleUpgradeRequest(HttpRequest req)
Determines whether the specified upgrade |
| private static List | |
| private boolean | Returns: true if the upgrade occurred, otherwise false.the context for this handler. ctx, final FullHttpRequest the HTTP request. request)Attempts to upgrade to the protocol(s) identified by the |
| handlingUpgrade | back to summary |
|---|---|
| private boolean handlingUpgrade | |
| headersFactory | back to summary |
|---|---|
| private final HttpHeadersFactory headersFactory | |
| sourceCodec | back to summary |
|---|---|
| private final HttpServerUpgradeHandler. | |
| trailersFactory | back to summary |
|---|---|
| private final HttpHeadersFactory trailersFactory | |
| upgradeCodecFactory | back to summary |
|---|---|
| private final HttpServerUpgradeHandler. | |
| HttpServerUpgradeHandler | back to summary |
|---|---|
| public HttpServerUpgradeHandler(HttpServerUpgradeHandler. Constructs the upgrader with the supported codecs.
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 | back to summary |
|---|---|
| public HttpServerUpgradeHandler(HttpServerUpgradeHandler. Constructs the upgrader with the supported codecs.
| |
| HttpServerUpgradeHandler | back to summary |
|---|---|
| public HttpServerUpgradeHandler(HttpServerUpgradeHandler. Constructs the upgrader with the supported codecs.
| |
| HttpServerUpgradeHandler | back to summary |
|---|---|
| public HttpServerUpgradeHandler(HttpServerUpgradeHandler. Constructs the upgrader with the supported codecs.
| |
| createUpgradeResponse | back to summary |
|---|---|
| private FullHttpResponse createUpgradeResponse(CharSequence upgradeProtocol) Creates the 101 Switching Protocols response message. | |
| decode | back to summary |
|---|---|
| protected void decode(ChannelHandlerContext ctx, HttpObject msg, List<Object> out) throws Exception Overrides io. Doc from io. Decode from one message to an other. This method will be called for each written message that can be handled by this decoder.
| |
| shouldHandleUpgradeRequest | back to summary |
|---|---|
| protected boolean shouldHandleUpgradeRequest(HttpRequest req) Determines whether the specified upgrade
| |
| splitHeader | back to summary |
|---|---|
| private static List Splits a comma-separated header value. The returned set is case-insensitive and contains each part with whitespace removed. | |
| upgrade | back to summary |
|---|---|
| private boolean upgrade(final ChannelHandlerContext ctx, final FullHttpRequest request) Attempts to upgrade to the protocol(s) identified by the
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | upgradeFrom(ChannelHandlerContext ctx)
Removes this codec (i.e. all associated handlers) from the pipeline. |
| upgradeFrom | back to summary |
|---|---|
| public void upgradeFrom(ChannelHandlerContext ctx) Removes this codec (i.e. all associated handlers) from the pipeline. | |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | prepareUpgradeResponse(ChannelHandlerContext ctx, FullHttpRequest upgradeRequest, HttpHeaders upgradeHeaders)
Prepares the |
| public Collection | requiredUpgradeHeaders()
Gets all protocol-specific headers required by this protocol for a successful upgrade. |
| public void | upgradeTo(ChannelHandlerContext
the context for the current handler. ctx, FullHttpRequest the request that triggered the upgrade to this protocol. upgradeRequest)Performs an HTTP protocol upgrade from the source codec. |
| prepareUpgradeResponse | back to summary |
|---|---|
| public boolean prepareUpgradeResponse(ChannelHandlerContext ctx, FullHttpRequest upgradeRequest, HttpHeaders upgradeHeaders) Prepares the | |
| requiredUpgradeHeaders | back to summary |
|---|---|
| public Collection Gets all protocol-specific headers required by this protocol for a successful upgrade.
Any supplied header will be required to appear in the | |
| upgradeTo | back to summary |
|---|---|
| public void upgradeTo(ChannelHandlerContext ctx, FullHttpRequest upgradeRequest) Performs an HTTP protocol upgrade from the source codec. This method is responsible for adding all handlers required for the new protocol.
| |
UpgradeCodec for the requested protocol name.
| Modifier and Type | Method and Description |
|---|---|
| public HttpServerUpgradeHandler. | newUpgradeCodec(CharSequence protocol)
Invoked by |
| newUpgradeCodec | back to summary |
|---|---|
| public HttpServerUpgradeHandler. Invoked by
| |
| Modifier and Type | Field and Description |
|---|---|
| private final CharSequence | |
| private final FullHttpRequest |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public CharSequence | |
| public int | refCnt()
Implements io. |
| public boolean | release()
Implements io. 1 and deallocates this object if the reference count reaches at
0.
|
| public boolean | release(int decrement)
Implements io. decrement and deallocates this object if the reference
count reaches at 0.
|
| public HttpServerUpgradeHandler. | |
| public HttpServerUpgradeHandler. | retain(int increment)
Implements io. increment.
|
| public String | |
| public HttpServerUpgradeHandler. | touch()
Implements io. |
| public HttpServerUpgradeHandler. | touch(Object hint)
Implements io. |
| public FullHttpRequest |
| protocol | back to summary |
|---|---|
| private final CharSequence protocol | |
| upgradeRequest | back to summary |
|---|---|
| private final FullHttpRequest upgradeRequest | |
| UpgradeEvent | back to summary |
|---|---|
| pack-priv UpgradeEvent(CharSequence protocol, FullHttpRequest upgradeRequest) | |
| protocol | back to summary |
|---|---|
| public CharSequence protocol() The protocol that the channel has been upgraded to. | |
| refCnt | back to summary |
|---|---|
| public int refCnt() Implements io. Doc from io. Returns the reference count of this object. If
| |
| release | back to summary |
|---|---|
| public boolean release() Implements io. Doc from io. Decreases the reference count by
| |
| release | back to summary |
|---|---|
| public boolean release(int decrement) Implements io. Doc from io. Decreases the reference count by the specified
| |
| retain | back to summary |
|---|---|
| public HttpServerUpgradeHandler. Implements io. Doc from io. Increases the reference count by
| |
| retain | back to summary |
|---|---|
| public HttpServerUpgradeHandler. Implements io. Doc from io. Increases the reference count by the specified
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| touch | back to summary |
|---|---|
| public HttpServerUpgradeHandler. Implements io. Doc from io. Records the current access location of this object for debugging purposes.
If this object is determined to be leaked, the information recorded by this operation will be provided to you
via
| |
| touch | back to summary |
|---|---|
| public HttpServerUpgradeHandler. Implements io. Doc from io. Records the current access location of this object with an additional arbitrary information for debugging
purposes. If this object is determined to be leaked, the information recorded by this operation will be
provided to you via
| |
| upgradeRequest | back to summary |
|---|---|
| public FullHttpRequest upgradeRequest() Gets the request that triggered the protocol upgrade. | |