Module io.netty.codec.http2
Package io.netty5.handler.codec.http2
Class CleartextHttp2ServerUpgradeHandler
- java.lang.Object
-
- io.netty5.channel.ChannelHandlerAdapter
-
- io.netty5.handler.codec.ByteToMessageDecoder
-
- io.netty5.handler.codec.http2.CleartextHttp2ServerUpgradeHandler
-
- All Implemented Interfaces:
ChannelHandler
@UnstableApi public final class CleartextHttp2ServerUpgradeHandler extends ByteToMessageDecoder
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 Class Summary
Nested Classes Modifier and Type Class Description static classCleartextHttp2ServerUpgradeHandler.PriorKnowledgeUpgradeEventUser event that is fired to notify about HTTP/2 protocol is started.-
Nested classes/interfaces inherited from class io.netty5.handler.codec.ByteToMessageDecoder
ByteToMessageDecoder.Cumulator
-
-
Field Summary
-
Fields inherited from class io.netty5.handler.codec.ByteToMessageDecoder
COMPOSITE_CUMULATOR, MERGE_CUMULATOR
-
-
Constructor Summary
Constructors Constructor Description CleartextHttp2ServerUpgradeHandler(HttpServerCodec httpServerCodec, HttpServerUpgradeHandler<?> httpServerUpgradeHandler, ChannelHandler http2ServerHandler)Creates the channel handler provide cleartext HTTP/2 upgrade from HTTP upgrade or prior knowledge
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddecode(ChannelHandlerContext ctx, Buffer in)Peek inbound message to determine current connection wants to start HTTP/2 by HTTP upgrade or prior knowledgevoidhandlerAdded0(ChannelHandlerContext ctx)-
Methods inherited from class io.netty5.handler.codec.ByteToMessageDecoder
actualReadableBytes, channelInactive, channelRead, channelReadComplete, channelShutdown, decodeLast, discardSomeReadBytes, handlerAdded, handlerRemoved, handlerRemoved0, internalBuffer, isSharable, isSingleDecode, setSingleDecode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.netty5.channel.ChannelHandler
bind, channelActive, channelExceptionCaught, channelInboundEvent, channelRegistered, channelUnregistered, channelWritabilityChanged, close, connect, deregister, disconnect, flush, pendingOutboundBytes, read, register, sendOutboundEvent, shutdown, write
-
-
-
-
Constructor Detail
-
CleartextHttp2ServerUpgradeHandler
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- the http server codechttpServerUpgradeHandler- the http server upgrade handler for HTTP/2http2ServerHandler- the http2 server handler, will be added into pipeline when starting HTTP/2 by prior knowledge
-
-
Method Detail
-
handlerAdded0
public void handlerAdded0(ChannelHandlerContext ctx) throws Exception
- Overrides:
handlerAdded0in classByteToMessageDecoder- Throws:
Exception
-
decode
protected void decode(ChannelHandlerContext ctx, Buffer in) throws Exception
Peek inbound message to determine current connection wants to start HTTP/2 by HTTP upgrade or prior knowledge- Specified by:
decodein classByteToMessageDecoder- Parameters:
ctx- theChannelHandlerContextwhich thisByteToMessageDecoderbelongs toin- theBufferfrom which to read data- Throws:
Exception- is thrown if an error occurs
-
-