Module io.helidon.webserver.http2
Package io.helidon.webserver.http2
Class Http2UpgradeCodecProvider
java.lang.Object
io.helidon.webserver.http2.Http2UpgradeCodecProvider
- All Implemented Interfaces:
UpgradeCodecProvider
Service providing HTTP/2 upgrade codec for Helidon webserver.
-
Constructor Summary
ConstructorDescriptionDeprecated.Only intended for service loader, do not instantiate -
Method Summary
Modifier and TypeMethodDescriptionName of the protocol expected inUpgrade
header during HTTP upgrade request for using decoder provided by this supplier.priorKnowledgeDecoder
(io.netty.handler.codec.http.HttpServerCodec httpServerCodec, io.netty.handler.codec.http.HttpServerUpgradeHandler wrappedUpgradeHandler, int maxContentLength) Used as a wrapper for actual upgrade handler, if available.Name of the protocol expected by ALPN negotiation for using this protocol, prior-knowledge decoder is expected to be used.io.netty.handler.codec.http.HttpServerUpgradeHandler.UpgradeCodec
upgradeCodec
(io.netty.handler.codec.http.HttpServerCodec httpServerCodec, Router router, int maxContentLength) Codec used by theHttpServerUpgradeHandler
whenclearTextProtocol()
matches.
-
Constructor Details
-
Http2UpgradeCodecProvider
Deprecated.Only intended for service loader, do not instantiateCreates a newHttp2UpgradeCodecProvider
.
-
-
Method Details
-
clearTextProtocol
Description copied from interface:UpgradeCodecProvider
Name of the protocol expected inUpgrade
header during HTTP upgrade request for using decoder provided by this supplier.- Specified by:
clearTextProtocol
in interfaceUpgradeCodecProvider
- Returns:
- protocol name
-
tlsProtocol
Description copied from interface:UpgradeCodecProvider
Name of the protocol expected by ALPN negotiation for using this protocol, prior-knowledge decoder is expected to be used.- Specified by:
tlsProtocol
in interfaceUpgradeCodecProvider
- Returns:
- name of the protocol supported by ALPN or empty optional
-
priorKnowledgeDecoder
public Optional<ChannelHandler> priorKnowledgeDecoder(io.netty.handler.codec.http.HttpServerCodec httpServerCodec, io.netty.handler.codec.http.HttpServerUpgradeHandler wrappedUpgradeHandler, int maxContentLength) Description copied from interface:UpgradeCodecProvider
Used as a wrapper for actual upgrade handler, if available. Provides prior-knowledge capability in case other side decides to skip HTTP upgrade.- Specified by:
priorKnowledgeDecoder
in interfaceUpgradeCodecProvider
- Parameters:
httpServerCodec
- For replacing HttpResponseEncoder and HttpRequestDecoder when usingHttpServerUpgradeHandler
wrappedUpgradeHandler
- Actual upgrade handler used when prior-knowledge doesn't kick inmaxContentLength
- maximum length of the content of an upgrade request- Returns:
- prior-knowledge decoder or empty optional
-
upgradeCodec
public io.netty.handler.codec.http.HttpServerUpgradeHandler.UpgradeCodec upgradeCodec(io.netty.handler.codec.http.HttpServerCodec httpServerCodec, Router router, int maxContentLength) Description copied from interface:UpgradeCodecProvider
Codec used by theHttpServerUpgradeHandler
whenclearTextProtocol()
matches.- Specified by:
upgradeCodec
in interfaceUpgradeCodecProvider
- Parameters:
httpServerCodec
- For replacing HttpResponseEncoder and HttpRequestDecoder when usingHttpServerUpgradeHandler
router
- set of all configured routingsmaxContentLength
- maximum length of the content of an upgrade request- Returns:
- upgrade codec
-