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

public final Class CleartextHttp2ServerUpgradeHandler

extends ByteToMessageDecoder
Class Inheritance
Annotations
@UnstableApi
Imports
io.netty5.buffer.BufferUtil, .Buffer, io.netty5.channel.ChannelHandler, .ChannelHandlerContext, io.netty5.handler.codec.ByteToMessageDecoder, io.netty5.handler.codec.http.HttpServerCodec, .HttpServerUpgradeHandler, io.netty5.util.internal.UnstableApi

Performing clear-text upgrade, by h2c HTTP upgrade or Prior Knowledge. This handler config pipeline for h2c upgrade when handler added. And will update pipeline once it detects 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 final ChannelHandler
private final HttpServerCodec
private final HttpServerUpgradeHandler<?>
Inherited from io.netty5.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, Buffer
the Buffer from which to read data
in
)

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

Peek inbound message to determine current connection wants to start HTTP/2 by HTTP upgrade or prior knowledge
public void
Inherited from io.netty5.handler.codec.ByteToMessageDecoder:
actualReadableByteschannelInactivechannelReadchannelReadCompletechannelShutdowndecodeLastdiscardSomeReadByteshandlerAddedhandlerRemovedhandlerRemoved0internalBufferisSharableisSingleDecodesetSingleDecode

Field Detail

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, Buffer in) throws Exception

Implements abstract io.netty5.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.netty5.handler.codec.ByteToMessageDecoder.decode.

the ChannelHandlerContext which this ByteToMessageDecoder belongs to

in:Buffer

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

the Buffer from which to read data

Annotations
@Override
Exceptions
Exception:

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

is thrown if an error occurs

handlerAdded0back to summary
public void handlerAdded0(ChannelHandlerContext ctx) throws Exception

Overrides io.netty5.handler.codec.ByteToMessageDecoder.handlerAdded0.

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

public final Class CleartextHttp2ServerUpgradeHandler.PriorKnowledgeUpgradeEvent

extends Object
Class Inheritance
  • java.lang.Object
  • io.netty5.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()