@UnstableApi public class Http2ClientUpgradeCodec extends java.lang.Object implements HttpClientUpgradeHandler.UpgradeCodec
| Constructor and Description |
|---|
Http2ClientUpgradeCodec(Http2ConnectionHandler connectionHandler)
Creates the codec using a default name for the connection handler when adding to the
pipeline.
|
Http2ClientUpgradeCodec(Http2FrameCodec frameCodec,
ChannelHandler upgradeToHandler) |
Http2ClientUpgradeCodec(java.lang.String handlerName,
Http2ConnectionHandler connectionHandler)
Creates the codec providing an upgrade to the given handler for HTTP/2.
|
Http2ClientUpgradeCodec(java.lang.String handlerName,
Http2FrameCodec frameCodec,
ChannelHandler upgradeToHandler) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.CharSequence |
protocol()
Returns the name of the protocol supported by this codec, as indicated by the
'UPGRADE' header. |
java.util.Collection<java.lang.CharSequence> |
setUpgradeHeaders(ChannelHandlerContext ctx,
HttpRequest upgradeRequest)
Sets any protocol-specific headers required to the upgrade request.
|
void |
upgradeTo(ChannelHandlerContext ctx,
FullHttpResponse upgradeResponse)
Performs an HTTP protocol upgrade from the source codec.
|
public Http2ClientUpgradeCodec(Http2FrameCodec frameCodec, ChannelHandler upgradeToHandler)
public Http2ClientUpgradeCodec(java.lang.String handlerName,
Http2FrameCodec frameCodec,
ChannelHandler upgradeToHandler)
public Http2ClientUpgradeCodec(Http2ConnectionHandler connectionHandler)
connectionHandler - the HTTP/2 connection handlerpublic Http2ClientUpgradeCodec(java.lang.String handlerName,
Http2ConnectionHandler connectionHandler)
handlerName - the name of the HTTP/2 connection handler to be used in the pipeline,
or null to auto-generate the nameconnectionHandler - the HTTP/2 connection handlerpublic java.lang.CharSequence protocol()
HttpClientUpgradeHandler.UpgradeCodec'UPGRADE' header.protocol in interface HttpClientUpgradeHandler.UpgradeCodecpublic java.util.Collection<java.lang.CharSequence> setUpgradeHeaders(ChannelHandlerContext ctx, HttpRequest upgradeRequest)
HttpClientUpgradeHandler.UpgradeCodecsetUpgradeHeaders in interface HttpClientUpgradeHandler.UpgradeCodecpublic void upgradeTo(ChannelHandlerContext ctx, FullHttpResponse upgradeResponse) throws java.lang.Exception
HttpClientUpgradeHandler.UpgradeCodecupgradeTo in interface HttpClientUpgradeHandler.UpgradeCodecctx - the context for the current handler.upgradeResponse - the 101 Switching Protocols response that indicates that the server
has switched to this protocol.java.lang.ExceptionCopyright © 2008–2019 The Netty Project. All rights reserved.