Top Description Fields Constructors Methods
io.netty.handler.codec.http2

public Class Http2ClientUpgradeCodec

extends Object
implements UpgradeCodec
Class Inheritance
All Implemented Interfaces
io.netty.handler.codec.http.HttpClientUpgradeHandler.UpgradeCodec
Annotations
@UnstableApi
Imports
io.netty.buffer.ByteBuf, io.netty.channel.ChannelHandler, .ChannelHandlerContext, io.netty.handler.codec.base64.Base64, io.netty.handler.codec.http.FullHttpResponse, .HttpClientUpgradeHandler, .HttpRequest, io.netty.util.collection.CharObjectMap, io.netty.util.internal.UnstableApi, java.util.Collection, .Collections, .List

Client-side cleartext upgrade codec from HTTP to HTTP/2.

Field Summary

Modifier and TypeField and Description
private final Http2ConnectionHandler
private final String
private final ChannelHandler
private static final List<CharSequence>
private final ChannelHandler

Constructor Summary

AccessConstructor and Description
public
public
Http2ClientUpgradeCodec(String handlerName, Http2FrameCodec frameCodec, ChannelHandler upgradeToHandler)

public
Http2ClientUpgradeCodec(Http2ConnectionHandler
the HTTP/2 connection handler
connectionHandler
)

Creates the codec using a default name for the connection handler when adding to the pipeline.

public
Http2ClientUpgradeCodec(Http2ConnectionHandler
the HTTP/2 connection handler
connectionHandler
,
Http2MultiplexHandler
the Http2 Multiplexer handler to work with Http2FrameCodec
http2MultiplexHandler
)

Creates the codec using a default name for the connection handler when adding to the pipeline.

public
Http2ClientUpgradeCodec(String
the name of the HTTP/2 connection handler to be used in the pipeline, or null to auto-generate the name
handlerName
,
Http2ConnectionHandler
the HTTP/2 connection handler
connectionHandler
)

Creates the codec providing an upgrade to the given handler for HTTP/2.

public
Http2ClientUpgradeCodec(String
the name of the HTTP/2 connection handler to be used in the pipeline, or null to auto-generate the name
handlerName
,
Http2ConnectionHandler
the HTTP/2 connection handler
connectionHandler
,
Http2MultiplexHandler http2MultiplexHandler)

Creates the codec providing an upgrade to the given handler for HTTP/2.

private
Http2ClientUpgradeCodec(String handlerName, Http2ConnectionHandler connectionHandler, ChannelHandler upgradeToHandler, Http2MultiplexHandler http2MultiplexHandler)

Method Summary

Modifier and TypeMethod and Description
private CharSequence
getSettingsHeaderValue(ChannelHandlerContext ctx)

Converts the current settings for the handler to the Base64-encoded representation used in the HTTP2-Settings upgrade header.

public CharSequence
protocol()

Implements io.netty.handler.codec.http.HttpClientUpgradeHandler.UpgradeCodec.protocol.

Returns the name of the protocol supported by this codec, as indicated by the 'UPGRADE' header.
public Collection<CharSequence>
setUpgradeHeaders(ChannelHandlerContext ctx, HttpRequest upgradeRequest)

Implements io.netty.handler.codec.http.HttpClientUpgradeHandler.UpgradeCodec.setUpgradeHeaders.

Sets any protocol-specific headers required to the upgrade request.
public void
upgradeTo(ChannelHandlerContext
the context for the current handler.
ctx
,
FullHttpResponse
the 101 Switching Protocols response that indicates that the server has switched to this protocol.
upgradeResponse
)

Implements io.netty.handler.codec.http.HttpClientUpgradeHandler.UpgradeCodec.upgradeTo.

Performs an HTTP protocol upgrade from the source codec.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

connectionHandlerback to summary
private final Http2ConnectionHandler connectionHandler
handlerNameback to summary
private final String handlerName
http2MultiplexHandlerback to summary
private final ChannelHandler http2MultiplexHandler
UPGRADE_HEADERSback to summary
private static final List<CharSequence> UPGRADE_HEADERS
upgradeToHandlerback to summary
private final ChannelHandler upgradeToHandler

Constructor Detail

Http2ClientUpgradeCodecback to summary
public Http2ClientUpgradeCodec(Http2FrameCodec frameCodec, ChannelHandler upgradeToHandler)
Http2ClientUpgradeCodecback to summary
public Http2ClientUpgradeCodec(String handlerName, Http2FrameCodec frameCodec, ChannelHandler upgradeToHandler)
Http2ClientUpgradeCodecback to summary
public Http2ClientUpgradeCodec(Http2ConnectionHandler connectionHandler)

Creates the codec using a default name for the connection handler when adding to the pipeline.

Parameters
connectionHandler:Http2ConnectionHandler

the HTTP/2 connection handler

Http2ClientUpgradeCodecback to summary
public Http2ClientUpgradeCodec(Http2ConnectionHandler connectionHandler, Http2MultiplexHandler http2MultiplexHandler)

Creates the codec using a default name for the connection handler when adding to the pipeline.

Parameters
connectionHandler:Http2ConnectionHandler

the HTTP/2 connection handler

http2MultiplexHandler:Http2MultiplexHandler

the Http2 Multiplexer handler to work with Http2FrameCodec

Http2ClientUpgradeCodecback to summary
public Http2ClientUpgradeCodec(String handlerName, Http2ConnectionHandler connectionHandler)

Creates the codec providing an upgrade to the given handler for HTTP/2.

Parameters
handlerName:String

the name of the HTTP/2 connection handler to be used in the pipeline, or null to auto-generate the name

connectionHandler:Http2ConnectionHandler

the HTTP/2 connection handler

Http2ClientUpgradeCodecback to summary
public Http2ClientUpgradeCodec(String handlerName, Http2ConnectionHandler connectionHandler, Http2MultiplexHandler http2MultiplexHandler)

Creates the codec providing an upgrade to the given handler for HTTP/2.

Parameters
handlerName:String

the name of the HTTP/2 connection handler to be used in the pipeline, or null to auto-generate the name

connectionHandler:Http2ConnectionHandler

the HTTP/2 connection handler

Http2ClientUpgradeCodecback to summary
private Http2ClientUpgradeCodec(String handlerName, Http2ConnectionHandler connectionHandler, ChannelHandler upgradeToHandler, Http2MultiplexHandler http2MultiplexHandler)

Method Detail

getSettingsHeaderValueback to summary
private CharSequence getSettingsHeaderValue(ChannelHandlerContext ctx)

Converts the current settings for the handler to the Base64-encoded representation used in the HTTP2-Settings upgrade header.

protocolback to summary
public CharSequence protocol()

Implements io.netty.handler.codec.http.HttpClientUpgradeHandler.UpgradeCodec.protocol.

Doc from io.netty.handler.codec.http.HttpClientUpgradeHandler.UpgradeCodec.protocol.

Returns the name of the protocol supported by this codec, as indicated by the 'UPGRADE' header.

Annotations
@Override
setUpgradeHeadersback to summary
public Collection<CharSequence> setUpgradeHeaders(ChannelHandlerContext ctx, HttpRequest upgradeRequest)

Implements io.netty.handler.codec.http.HttpClientUpgradeHandler.UpgradeCodec.setUpgradeHeaders.

Doc from io.netty.handler.codec.http.HttpClientUpgradeHandler.UpgradeCodec.setUpgradeHeaders.

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.

Annotations
@Override
upgradeToback to summary
public void upgradeTo(ChannelHandlerContext ctx, FullHttpResponse upgradeResponse) throws Exception

Implements io.netty.handler.codec.http.HttpClientUpgradeHandler.UpgradeCodec.upgradeTo.

Doc from io.netty.handler.codec.http.HttpClientUpgradeHandler.UpgradeCodec.upgradeTo.

Performs an HTTP protocol upgrade from the source codec. This method is responsible for adding all handlers required for the new protocol.

Parameters
ctx:ChannelHandlerContext

the context for the current handler.

upgradeResponse:FullHttpResponse

the 101 Switching Protocols response that indicates that the server has switched to this protocol.

Annotations
@Override