Class AltSvc

java.lang.Object
io.helidon.webserver.http.AltSvc
All Implemented Interfaces:
RuntimeType.Api<AltSvcConfig>

public final class AltSvc extends Object implements RuntimeType.Api<AltSvcConfig>
Runtime support for a single advertised alternative service. Each instance is bound to at most one listener.
  • Method Details

    • builder

      public static AltSvcConfig.Builder builder()
      Create a fluent API builder.
      Returns:
      a new builder
    • create

      public static AltSvc create(AltSvcConfig config)
      Create from its configuration prototype.
      Parameters:
      config - configuration prototype
      Returns:
      a new alternative service runtime
    • create

      public static AltSvc create(Consumer<AltSvcConfig.Builder> consumer)
      Create by customizing the configuration builder.
      Parameters:
      consumer - builder customizer
      Returns:
      a new alternative service runtime
    • prototype

      public AltSvcConfig prototype()
      Description copied from interface: RuntimeType.Api
      The prototype as it was received when creating this runtime object instance.
      Specified by:
      prototype in interface RuntimeType.Api<AltSvcConfig>
      Returns:
      prototype object used to create this instance
    • header

      public Header header(int listenerPort)
      Create the header for the provided listener port.
      Parameters:
      listenerPort - current listener port
      Returns:
      header
      Throws:
      IllegalArgumentException - if there is no valid effective port
      IllegalStateException - if this instance is reused for a different listener port
    • headerValue

      public String headerValue(int listenerPort)
      Create the header value for the provided listener port.
      Parameters:
      listenerPort - current listener port
      Returns:
      header value
      Throws:
      IllegalArgumentException - if there is no valid effective port
      IllegalStateException - if this instance is reused for a different listener port