| Modifier and Type | Class and Description |
|---|---|
| public static interface | HttpClientUpgradeHandler.SourceCodec
The source codec that is used in the pipeline initially. |
| public static interface | HttpClientUpgradeHandler.UpgradeCodec
A codec that the source can be upgraded to. |
| public static enum | HttpClientUpgradeHandler.UpgradeEvent
User events that are fired to notify about upgrade status. |
| Modifier and Type | Field and Description |
|---|---|
| private final HttpClientUpgradeHandler. | |
| private final HttpClientUpgradeHandler. | |
| private boolean |
| Access | Constructor and Description |
|---|---|
| public | HttpClientUpgradeHandler(HttpClientUpgradeHandler.
the codec that is being used initially. sourceCodec,the codec that the client would like to upgrade to. upgradeCodec,the maximum length of the aggregated content. maxContentLength)Constructs the client upgrade handler. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | decode(final ChannelHandlerContext
the ctx, HttpObject ChannelHandlerContext which this MessageToMessageDecoder belongs tothe message to decode to another one msg)
Decode from one message to another.
|
| private static void | |
| private void | setUpgradeRequestHeaders(ChannelHandlerContext ctx, HttpRequest request)
Adds all upgrade request headers necessary for an upgrade to the supported protocols. |
| private void | |
| public Future | write(ChannelHandlerContext
the ctx, Object ChannelHandlerContext for which the write operation is madethe message to write msg)Overrides default io. |
| sourceCodec | back to summary |
|---|---|
| private final HttpClientUpgradeHandler. | |
| upgradeCodec | back to summary |
|---|---|
| private final HttpClientUpgradeHandler. | |
| upgradeRequested | back to summary |
|---|---|
| private boolean upgradeRequested | |
| HttpClientUpgradeHandler | back to summary |
|---|---|
| public HttpClientUpgradeHandler(HttpClientUpgradeHandler. Constructs the client upgrade handler.
| |
| decode | back to summary |
|---|---|
| protected void decode(final ChannelHandlerContext ctx, HttpObject msg) throws Exception Overrides io. Doc from io. Decode from one message to another. This method will be called for each written message that can be handled by this decoder. The message will be disposed of after this call.
Subclasses that wish to sometimes pass messages through, should instead override the
| |
| removeThisHandler | back to summary |
|---|---|
| private static void removeThisHandler(ChannelHandlerContext ctx) | |
| setUpgradeRequestHeaders | back to summary |
|---|---|
| private void setUpgradeRequestHeaders(ChannelHandlerContext ctx, HttpRequest request) Adds all upgrade request headers necessary for an upgrade to the supported protocols. | |
| tryUpgrade | back to summary |
|---|---|
| private void tryUpgrade(ChannelHandlerContext ctx, FullHttpResponse response) | |
| write | back to summary |
|---|---|
| public Future Overrides default io. Doc from io. Called once a write operation is made. The write operation will write the messages through the
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | prepareUpgradeFrom(ChannelHandlerContext ctx)
Removes or disables the encoder of this codec so that the |
| public void | upgradeFrom(ChannelHandlerContext ctx)
Removes this codec (i.e. all associated handlers) from the pipeline. |
| prepareUpgradeFrom | back to summary |
|---|---|
| public void prepareUpgradeFrom(ChannelHandlerContext ctx) Removes or disables the encoder of this codec so that the | |
| 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 CharSequence | protocol()
Returns the name of the protocol supported by this codec, as indicated by the |
| public Collection | setUpgradeHeaders(ChannelHandlerContext ctx, HttpRequest upgradeRequest)
Sets any protocol-specific headers required to the upgrade request. |
| public void | upgradeTo(ChannelHandlerContext
the context for the current handler. ctx, Send<FullHttpResponse> the 101 Switching Protocols response that indicates that the server
has switched to this protocol. upgradeResponse)Performs an HTTP protocol upgrade from the source codec. |
| protocol | back to summary |
|---|---|
| public CharSequence protocol() Returns the name of the protocol supported by this codec, as indicated by the | |
| setUpgradeHeaders | back to summary |
|---|---|
| public Collection Sets any protocol-specific headers required to the upgrade request. Returns the names of all headers that were added. These headers will be used to populate the CONNECTION header. | |
| upgradeTo | back to summary |
|---|---|
| public void upgradeTo(ChannelHandlerContext ctx, Send<FullHttpResponse> upgradeResponse) throws Exception Performs an HTTP protocol upgrade from the source codec. This method is responsible for adding all handlers required for the new protocol.
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final HttpClientUpgradeHandler. | UPGRADE_ISSUED
The Upgrade request was sent to the server. |
| public static final HttpClientUpgradeHandler. | UPGRADE_REJECTED
The Upgrade was unsuccessful due to the server not issuing with a 101 Switching Protocols response. |
| public static final HttpClientUpgradeHandler. | UPGRADE_SUCCESSFUL
The Upgrade to the new protocol was successful. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static HttpClientUpgradeHandler. | |
| public static HttpClientUpgradeHandler. |
| UPGRADE_ISSUED | back to summary |
|---|---|
| public static final HttpClientUpgradeHandler. The Upgrade request was sent to the server. | |
| UPGRADE_REJECTED | back to summary |
|---|---|
| public static final HttpClientUpgradeHandler. The Upgrade was unsuccessful due to the server not issuing with a 101 Switching Protocols response. | |
| UPGRADE_SUCCESSFUL | back to summary |
|---|---|
| public static final HttpClientUpgradeHandler. The Upgrade to the new protocol was successful. | |
| UpgradeEvent | back to summary |
|---|---|
| private UpgradeEvent() | |
| valueOf | back to summary |
|---|---|
| public static HttpClientUpgradeHandler. | |
| values | back to summary |
|---|---|
| public static HttpClientUpgradeHandler. | |