Class Http2Config.BuilderBase<BUILDER extends Http2Config.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Http2Config>

java.lang.Object
io.helidon.webserver.http2.Http2Config.BuilderBase<BUILDER,PROTOTYPE>
Type Parameters:
BUILDER - type of the builder extending this abstract builder
PROTOTYPE - type of the prototype interface that would be built by Prototype.Builder.buildPrototype()
All Implemented Interfaces:
Prototype.Builder<BUILDER,PROTOTYPE>, Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
Http2Config.Builder
Enclosing interface:
Http2Config

public abstract static class Http2Config.BuilderBase<BUILDER extends Http2Config.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Http2Config> extends Object implements Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for Http2Config.
  • Constructor Details

    • BuilderBase

      protected BuilderBase()
      Protected to support extensibility.
  • Method Details

    • from

      public BUILDER from(Http2Config prototype)
      Update this builder from an existing prototype instance. This method disables automatic service discovery.
      Parameters:
      prototype - existing prototype to update this builder from
      Returns:
      updated builder instance
    • from

      public BUILDER from(Http2Config.BuilderBase<?,?> builder)
      Update this builder from an existing prototype builder instance.
      Parameters:
      builder - existing builder prototype to update this builder from
      Returns:
      updated builder instance
    • config

      public BUILDER config(Config config)
      Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.
      Specified by:
      config in interface Prototype.ConfiguredBuilder<BUILDER extends Http2Config.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Http2Config>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • maxFrameSize

      public BUILDER maxFrameSize(int maxFrameSize)
      The size of the largest frame payload that the sender is willing to receive in bytes. Default value is 16384 and maximum value is 224-1 = 16777215 bytes. See RFC 9113 section 6.5.2 for details.
      Parameters:
      maxFrameSize - maximal frame size
      Returns:
      updated builder instance
      See Also:
    • maxHeaderListSize

      public BUILDER maxHeaderListSize(long maxHeaderListSize)
      The maximum field section size that the sender is prepared to accept in bytes. See RFC 9113 section 6.5.2 for details. Default is 8192.
      Parameters:
      maxHeaderListSize - maximal header list size in bytes
      Returns:
      updated builder instance
      See Also:
    • maxConcurrentStreams

      public BUILDER maxConcurrentStreams(long maxConcurrentStreams)
      Maximum number of concurrent streams that the server will allow. Defaults to 8192. This limit is directional: it applies to the number of streams that the sender permits the receiver to create. It is recommended that this value be no smaller than 100 to not unnecessarily limit parallelism See RFC 9113 section 6.5.2 for details.
      Parameters:
      maxConcurrentStreams - maximal number of concurrent streams
      Returns:
      updated builder instance
      See Also:
    • initialWindowSize

      public BUILDER initialWindowSize(int initialWindowSize)
      This setting indicates the sender's maximum window size in bytes for stream-level flow control. Default and maximum value is 231-1 = 2147483647 bytes. This setting affects the window size of HTTP/2 connection. Any value greater than 2147483647 causes an error. Any value smaller than initial window size causes an error. See RFC 9113 section 6.9.1 for details.
      Parameters:
      initialWindowSize - maximum window size in bytes
      Returns:
      updated builder instance
      See Also:
    • flowControlTimeout

      public BUILDER flowControlTimeout(Duration flowControlTimeout)
      Outbound flow control blocking timeout configured as Duration or text in ISO-8601 format. Blocking timeout defines an interval to wait for the outbound window size changes(incoming window updates) before the next blocking iteration. Default value is PT0.1S.
      ISO_8601 format examples:
      PT0.1S100 milliseconds
      PT0.5S500 milliseconds
      PT2S2 seconds
      Parameters:
      flowControlTimeout - duration
      Returns:
      updated builder instance
      See Also:
    • sendErrorDetails

      public BUILDER sendErrorDetails(boolean sendErrorDetails)
      Whether to send error message over HTTP to client. Defaults to false, as exception message may contain internal information that could be used as an attack vector. Use with care and in cases where both server and clients are under your full control (such as for testing).
      Parameters:
      sendErrorDetails - whether to send error messages over the network
      Returns:
      updated builder instance
      See Also:
    • rapidResetCheckPeriod

      public BUILDER rapidResetCheckPeriod(Duration rapidResetCheckPeriod)
      Period for counting rapid resets(stream RST sent by client before any data have been sent by server). Default value is PT10S.
      Parameters:
      rapidResetCheckPeriod - duration
      Returns:
      updated builder instance
      See Also:
    • maxRapidResets

      public BUILDER maxRapidResets(int maxRapidResets)
      Maximum number of rapid resets(stream RST sent by client before any data have been sent by server). When reached within rapidResetCheckPeriod(), GOAWAY is sent to client and connection is closed. Default value is 100.
      Parameters:
      maxRapidResets - maximum number of rapid resets
      Returns:
      updated builder instance
      See Also:
    • maxEmptyFrames

      public BUILDER maxEmptyFrames(int maxEmptyFrames)
      Maximum number of consecutive empty frames allowed on connection.
      Parameters:
      maxEmptyFrames - max number of consecutive empty frames
      Returns:
      updated builder instance
      See Also:
    • validatePath

      public BUILDER validatePath(boolean validatePath)
      If set to false, any path is accepted (even containing illegal characters).
      Parameters:
      validatePath - whether to validate path
      Returns:
      updated builder instance
      See Also:
    • requestedUriDiscovery

      public BUILDER requestedUriDiscovery(RequestedUriDiscoveryContext requestedUriDiscovery)
      Requested URI discovery settings.
      Parameters:
      requestedUriDiscovery - settings for computing the requested URI
      Returns:
      updated builder instance
      See Also:
    • requestedUriDiscovery

      public BUILDER requestedUriDiscovery(Consumer<RequestedUriDiscoveryContext.Builder> consumer)
      Requested URI discovery settings.
      Parameters:
      consumer - consumer of builder for settings for computing the requested URI
      Returns:
      updated builder instance
      See Also:
    • requestedUriDiscovery

      public BUILDER requestedUriDiscovery(Supplier<? extends RequestedUriDiscoveryContext> supplier)
      Requested URI discovery settings.
      Parameters:
      supplier - supplier of settings for computing the requested URI
      Returns:
      updated builder instance
      See Also:
    • name

      public BUILDER name(String name)
      Parameters:
      name -
      Returns:
      updated builder instance
      See Also:
    • maxFrameSize

      public int maxFrameSize()
      The size of the largest frame payload that the sender is willing to receive in bytes. Default value is 16384 and maximum value is 224-1 = 16777215 bytes. See RFC 9113 section 6.5.2 for details.
      Returns:
      the max frame size
    • maxHeaderListSize

      public long maxHeaderListSize()
      The maximum field section size that the sender is prepared to accept in bytes. See RFC 9113 section 6.5.2 for details. Default is 8192.
      Returns:
      the max header list size
    • maxConcurrentStreams

      public long maxConcurrentStreams()
      Maximum number of concurrent streams that the server will allow. Defaults to 8192. This limit is directional: it applies to the number of streams that the sender permits the receiver to create. It is recommended that this value be no smaller than 100 to not unnecessarily limit parallelism See RFC 9113 section 6.5.2 for details.
      Returns:
      the max concurrent streams
    • initialWindowSize

      public int initialWindowSize()
      This setting indicates the sender's maximum window size in bytes for stream-level flow control. Default and maximum value is 231-1 = 2147483647 bytes. This setting affects the window size of HTTP/2 connection. Any value greater than 2147483647 causes an error. Any value smaller than initial window size causes an error. See RFC 9113 section 6.9.1 for details.
      Returns:
      the initial window size
    • flowControlTimeout

      public Duration flowControlTimeout()
      Outbound flow control blocking timeout configured as Duration or text in ISO-8601 format. Blocking timeout defines an interval to wait for the outbound window size changes(incoming window updates) before the next blocking iteration. Default value is PT0.1S.
      ISO_8601 format examples:
      PT0.1S100 milliseconds
      PT0.5S500 milliseconds
      PT2S2 seconds
      Returns:
      the flow control timeout
      See Also:
    • sendErrorDetails

      public boolean sendErrorDetails()
      Whether to send error message over HTTP to client. Defaults to false, as exception message may contain internal information that could be used as an attack vector. Use with care and in cases where both server and clients are under your full control (such as for testing).
      Returns:
      the send error details
    • rapidResetCheckPeriod

      public Duration rapidResetCheckPeriod()
      Period for counting rapid resets(stream RST sent by client before any data have been sent by server). Default value is PT10S.
      Returns:
      the rapid reset check period
      See Also:
    • maxRapidResets

      public int maxRapidResets()
      Maximum number of rapid resets(stream RST sent by client before any data have been sent by server). When reached within rapidResetCheckPeriod(), GOAWAY is sent to client and connection is closed. Default value is 100.
      Returns:
      the max rapid resets
      See Also:
    • maxEmptyFrames

      public int maxEmptyFrames()
      Maximum number of consecutive empty frames allowed on connection.
      Returns:
      the max empty frames
    • validatePath

      public boolean validatePath()
      If set to false, any path is accepted (even containing illegal characters).
      Returns:
      the validate path
    • requestedUriDiscovery

      public Optional<RequestedUriDiscoveryContext> requestedUriDiscovery()
      Requested URI discovery settings.
      Returns:
      the requested uri discovery
    • name

      public Optional<String> name()
      Returns:
      the name
    • config

      public Optional<Config> config()
      If this instance was configured, this would be the config instance used.
      Returns:
      config node used to configure this builder, or empty if not configured
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.