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

public final Class CleartextHttp2ServerUpgradeHandler

extends ByteToMessageDecoder
Class Inheritance
Annotations
@UnstableApi
Imports
io.netty.buffer.ByteBuf, .ByteBufUtil, io.netty.channel.ChannelHandler, .ChannelHandlerContext, io.netty.handler.codec.ByteToMessageDecoder, io.netty.handler.codec.http.HttpServerCodec, .HttpServerUpgradeHandler, io.netty.util.internal.UnstableApi, java.util.List

Performing cleartext upgrade, by h2c HTTP upgrade or Prior Knowledge. This handler config pipeline for h2c upgrade when handler added. And will update pipeline once it detect the connection is starting HTTP/2 by prior knowledge or not.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
CleartextHttp2ServerUpgradeHandler.PriorKnowledgeUpgradeEvent

User event that is fired to notify about HTTP/2 protocol is started.

Field Summary

Modifier and TypeField and Description
private static final ByteBuf
private final ChannelHandler
private final HttpServerCodec
private final HttpServerUpgradeHandler
Inherited from io.netty.handler.codec.ByteToMessageDecoder:
COMPOSITE_CUMULATORMERGE_CUMULATOR

Constructor Summary

AccessConstructor and Description
public
CleartextHttp2ServerUpgradeHandler(HttpServerCodec
the http server codec
httpServerCodec
,
HttpServerUpgradeHandler
the http server upgrade handler for HTTP/2
httpServerUpgradeHandler
,
ChannelHandler
the http2 server handler, will be added into pipeline when starting HTTP/2 by prior knowledge
http2ServerHandler
)

Creates the channel handler provide cleartext HTTP/2 upgrade from HTTP upgrade or prior knowledge

Method Summary

Modifier and TypeMethod and Description
protected void
decode(ChannelHandlerContext ctx, ByteBuf
the ByteBuf from which to read data
in
,
List<Object>
the List to which decoded messages should be added
out
)

Implements abstract io.netty.handler.codec.ByteToMessageDecoder.decode.

Peek inbound message to determine current connection wants to start HTTP/2 by HTTP upgrade or prior knowledge
public void
handlerAdded(ChannelHandlerContext ctx)

Overrides io.netty.channel.ChannelHandlerAdapter.handlerAdded.

Implements io.netty.channel.ChannelHandler.handlerAdded.

Gets called after the ChannelHandler was added to the actual context and it's ready to handle events.
Inherited from io.netty.handler.codec.ByteToMessageDecoder:
actualReadableBytescallDecodechannelInactivechannelReadchannelReadCompletedecodeLastdiscardSomeReadByteshandlerRemovedhandlerRemoved0internalBufferisSingleDecodesetCumulatorsetDiscardAfterReadssetSingleDecodeuserEventTriggered

Field Detail

CONNECTION_PREFACEback to summary
private static final ByteBuf CONNECTION_PREFACE
http2ServerHandlerback to summary
private final ChannelHandler http2ServerHandler
httpServerCodecback to summary
private final HttpServerCodec httpServerCodec
httpServerUpgradeHandlerback to summary
private final HttpServerUpgradeHandler httpServerUpgradeHandler

Constructor Detail

CleartextHttp2ServerUpgradeHandlerback to summary
public CleartextHttp2ServerUpgradeHandler(HttpServerCodec httpServerCodec, HttpServerUpgradeHandler httpServerUpgradeHandler, ChannelHandler http2ServerHandler)

Creates the channel handler provide cleartext HTTP/2 upgrade from HTTP upgrade or prior knowledge

Parameters
httpServerCodec:HttpServerCodec

the http server codec

httpServerUpgradeHandler:HttpServerUpgradeHandler

the http server upgrade handler for HTTP/2

http2ServerHandler:ChannelHandler

the http2 server handler, will be added into pipeline when starting HTTP/2 by prior knowledge

Method Detail

decodeback to summary
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception

Implements abstract io.netty.handler.codec.ByteToMessageDecoder.decode.

Peek inbound message to determine current connection wants to start HTTP/2 by HTTP upgrade or prior knowledge

Parameters
ctx:ChannelHandlerContext

Doc from io.netty.handler.codec.ByteToMessageDecoder.decode.

the ChannelHandlerContext which this ByteToMessageDecoder belongs to

in:ByteBuf

Doc from io.netty.handler.codec.ByteToMessageDecoder.decode.

the ByteBuf from which to read data

out:List<Object>

Doc from io.netty.handler.codec.ByteToMessageDecoder.decode.

the List to which decoded messages should be added

Annotations
@Override
Exceptions
Exception:

Doc from io.netty.handler.codec.ByteToMessageDecoder.decode.

is thrown if an error occurs

handlerAddedback to summary
public void handlerAdded(ChannelHandlerContext ctx) throws Exception

Overrides io.netty.channel.ChannelHandlerAdapter.handlerAdded.

Implements io.netty.channel.ChannelHandler.handlerAdded.

Doc from io.netty.channel.ChannelHandler.handlerAdded.

Gets called after the ChannelHandler was added to the actual context and it's ready to handle events.

Annotations
@Override
io.netty.handler.codec.http2 back to summary

public final Class CleartextHttp2ServerUpgradeHandler.PriorKnowledgeUpgradeEvent

extends Object
Class Inheritance
  • java.lang.Object
  • io.netty.handler.codec.http2.CleartextHttp2ServerUpgradeHandler.PriorKnowledgeUpgradeEvent

User event that is fired to notify about HTTP/2 protocol is started.

Field Summary

Modifier and TypeField and Description
private static final CleartextHttp2ServerUpgradeHandler.PriorKnowledgeUpgradeEvent

Constructor Summary

AccessConstructor and Description
private

Method Summary

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

INSTANCEback to summary
private static final CleartextHttp2ServerUpgradeHandler.PriorKnowledgeUpgradeEvent INSTANCE

Constructor Detail

PriorKnowledgeUpgradeEventback to summary
private PriorKnowledgeUpgradeEvent()