Class Http2UpgradeCodecProvider

java.lang.Object
io.helidon.webserver.http2.Http2UpgradeCodecProvider
All Implemented Interfaces:
UpgradeCodecProvider

public class Http2UpgradeCodecProvider extends Object implements UpgradeCodecProvider
Service providing HTTP/2 upgrade codec for Helidon webserver.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Only intended for service loader, do not instantiate
  • Method Summary

    Modifier and Type
    Method
    Description
    Name of the protocol expected in Upgrade 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 the HttpServerUpgradeHandler when clearTextProtocol() matches.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Http2UpgradeCodecProvider

      @Deprecated public Http2UpgradeCodecProvider()
      Deprecated.
      Only intended for service loader, do not instantiate
  • Method Details

    • clearTextProtocol

      public CharSequence clearTextProtocol()
      Description copied from interface: UpgradeCodecProvider
      Name of the protocol expected in Upgrade header during HTTP upgrade request for using decoder provided by this supplier.
      Specified by:
      clearTextProtocol in interface UpgradeCodecProvider
      Returns:
      protocol name
    • tlsProtocol

      public Optional<String> 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 interface UpgradeCodecProvider
      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 interface UpgradeCodecProvider
      Parameters:
      httpServerCodec - For replacing HttpResponseEncoder and HttpRequestDecoder when using HttpServerUpgradeHandler
      wrappedUpgradeHandler - Actual upgrade handler used when prior-knowledge doesn't kick in
      maxContentLength - 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 the HttpServerUpgradeHandler when clearTextProtocol() matches.
      Specified by:
      upgradeCodec in interface UpgradeCodecProvider
      Parameters:
      httpServerCodec - For replacing HttpResponseEncoder and HttpRequestDecoder when using HttpServerUpgradeHandler
      router - set of all configured routings
      maxContentLength - maximum length of the content of an upgrade request
      Returns:
      upgrade codec