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

java.lang.Object
io.helidon.http.HttpConfig.BuilderBase<BUILDER,PROTOTYPE>
io.helidon.webserver.http1.Http1Config.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>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
Http1Config.Builder
Enclosing interface:
Http1Config

public abstract static class Http1Config.BuilderBase<BUILDER extends Http1Config.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Http1Config> extends HttpConfig.BuilderBase<BUILDER,PROTOTYPE> implements ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for Http1Config.
  • Constructor Details

    • BuilderBase

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

    • from

      public BUILDER from(Http1Config 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(Http1Config.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

      @Deprecated 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 ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends Http1Config.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Http1Config>
      Overrides:
      config in class HttpConfig.BuilderBase<BUILDER extends Http1Config.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Http1Config>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      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 ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends Http1Config.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Http1Config>
      Overrides:
      config in class HttpConfig.BuilderBase<BUILDER extends Http1Config.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Http1Config>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • name

      public BUILDER name(String name)
      Name of this configuration, in most cases the same as Http1Config.type().
      Parameters:
      name - name of this configuration
      Returns:
      updated builder instance
      See Also:
    • maxPrologueLength

      public BUILDER maxPrologueLength(int maxPrologueLength)
      Maximal size of received HTTP prologue (GET /path HTTP/1.1).
      Parameters:
      maxPrologueLength - maximal size in bytes
      Returns:
      updated builder instance
      See Also:
    • maxHeadersSize

      public BUILDER maxHeadersSize(int maxHeadersSize)
      Maximal size of received headers in bytes.
      Parameters:
      maxHeadersSize - maximal header size
      Returns:
      updated builder instance
      See Also:
    • validateRequestHostHeader

      @Deprecated(since="4.1.3", forRemoval=true) public BUILDER validateRequestHostHeader(boolean validateRequestHostHeader)
      Deprecated, for removal: This API element is subject to removal in a future version.
      this switch exists for temporary backward compatible behavior, and will be removed in a future Helidon version
      Request host header validation. When host header is invalid, we return Status.BAD_REQUEST_400.

      The validation is done according to RFC-3986 (see UriValidator). This is a requirement of the HTTP specification.

      This option allows you to disable the "full-blown" validation ("simple" validation is still in - the port must be parseable to integer).

      Parameters:
      validateRequestHostHeader - whether to do a full validation of Host header according to the specification
      Returns:
      updated builder instance
      See Also:
    • sendKeepAliveHeader

      public BUILDER sendKeepAliveHeader(boolean sendKeepAliveHeader)
      Whether to send the default Connection: keep-alive response header for persistent HTTP/1.1 connections.

      RFC 9112 does not require this header for persistent connections, but Helidon 4 defaults to true for backward compatibility. Set this to false to omit the header unless the application sets it explicitly.

      Parameters:
      sendKeepAliveHeader - whether to send the default keep-alive response header
      Returns:
      updated builder instance
      See Also:
    • validatePrologue

      public BUILDER validatePrologue(boolean validatePrologue)
      If set to false, any query and fragment is accepted (even containing illegal characters). Validation of path is controlled by validatePath().
      Parameters:
      validatePrologue - whether to validate prologue query and fragment
      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:
    • continueImmediately

      public BUILDER continueImmediately(boolean continueImmediately)
      When true WebServer answers to expect continue with 100 continue immediately, not waiting for user to actually request the data.
      Parameters:
      continueImmediately - if true answer with 100 continue immediately after expect continue
      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 of 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:
    • clearSendListeners

      public BUILDER clearSendListeners()
      Clear all sendListeners.
      Returns:
      updated builder instance
      See Also:
    • sendListeners

      public BUILDER sendListeners(List<? extends Http1ConnectionListener> sendListeners)
      Connection send event listeners for HTTP/1.1.
      Parameters:
      sendListeners - send event listeners
      Returns:
      updated builder instance
      See Also:
    • addSendListeners

      public BUILDER addSendListeners(List<? extends Http1ConnectionListener> sendListeners)
      Connection send event listeners for HTTP/1.1.
      Parameters:
      sendListeners - send event listeners
      Returns:
      updated builder instance
      See Also:
    • addSendListener

      public BUILDER addSendListener(Http1ConnectionListener sendListener)
      Connection send event listeners for HTTP/1.1.
      Parameters:
      sendListener - add single send event listeners
      Returns:
      updated builder instance
      See Also:
    • clearReceiveListeners

      public BUILDER clearReceiveListeners()
      Clear all receiveListeners.
      Returns:
      updated builder instance
      See Also:
    • receiveListeners

      public BUILDER receiveListeners(List<? extends Http1ConnectionListener> receiveListeners)
      Connection receive event listeners for HTTP/1.1.
      Parameters:
      receiveListeners - receive event listeners
      Returns:
      updated builder instance
      See Also:
    • addReceiveListeners

      public BUILDER addReceiveListeners(List<? extends Http1ConnectionListener> receiveListeners)
      Connection receive event listeners for HTTP/1.1.
      Parameters:
      receiveListeners - receive event listeners
      Returns:
      updated builder instance
      See Also:
    • addReceiveListener

      public BUILDER addReceiveListener(Http1ConnectionListener receiveListener)
      Connection receive event listeners for HTTP/1.1.
      Parameters:
      receiveListener - add single receive event listeners
      Returns:
      updated builder instance
      See Also:
    • compositeSendListener

      public BUILDER compositeSendListener(Http1ConnectionListener compositeSendListener)
      A single send listener, this value is computed.
      Parameters:
      compositeSendListener - send listener
      Returns:
      updated builder instance
      See Also:
    • compositeReceiveListener

      public BUILDER compositeReceiveListener(Http1ConnectionListener compositeReceiveListener)
      A single receive listener, this value is computed.
      Parameters:
      compositeReceiveListener - receive listener
      Returns:
      updated builder instance
      See Also:
    • receiveLog

      @Deprecated(since="4.5.0", forRemoval=true) public BUILDER receiveLog(boolean receiveLog)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Logging of received packets. Uses trace and debug levels on logger of Http1LoggingConnectionListener with suffix of .recv`.
      Parameters:
      receiveLog - true if logging should be enabled for received packets, false if no logging should be done
      Returns:
      updated builder instance
      See Also:
    • sendLog

      @Deprecated(since="4.5.0", forRemoval=true) public BUILDER sendLog(boolean sendLog)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Logging of sent packets. Uses trace and debug levels on logger of Http1LoggingConnectionListener with suffix of .send`.
      Parameters:
      sendLog - true if logging should be enabled for sent packets, false if no logging should be done
      Returns:
      updated builder instance
      See Also:
    • name

      public Optional<String> name()
      Name of this configuration, in most cases the same as Http1Config.type().
      Returns:
      name of this configuration
    • maxPrologueLength

      public int maxPrologueLength()
      Maximal size of received HTTP prologue (GET /path HTTP/1.1).
      Returns:
      maximal size in bytes
    • maxHeadersSize

      public int maxHeadersSize()
      Maximal size of received headers in bytes.
      Returns:
      maximal header size
    • validateRequestHostHeader

      @Deprecated(since="4.1.3", forRemoval=true) public boolean validateRequestHostHeader()
      Deprecated, for removal: This API element is subject to removal in a future version.
      this switch exists for temporary backward compatible behavior, and will be removed in a future Helidon version
      Request host header validation. When host header is invalid, we return Status.BAD_REQUEST_400.

      The validation is done according to RFC-3986 (see UriValidator). This is a requirement of the HTTP specification.

      This option allows you to disable the "full-blown" validation ("simple" validation is still in - the port must be parseable to integer).

      Returns:
      whether to do a full validation of Host header according to the specification
    • sendKeepAliveHeader

      public boolean sendKeepAliveHeader()
      Whether to send the default Connection: keep-alive response header for persistent HTTP/1.1 connections.

      RFC 9112 does not require this header for persistent connections, but Helidon 4 defaults to true for backward compatibility. Set this to false to omit the header unless the application sets it explicitly.

      Returns:
      whether to send the default keep-alive response header
    • validatePrologue

      public boolean validatePrologue()
      If set to false, any query and fragment is accepted (even containing illegal characters). Validation of path is controlled by validatePath().
      Returns:
      whether to validate prologue query and fragment
    • validatePath

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

      public boolean continueImmediately()
      When true WebServer answers to expect continue with 100 continue immediately, not waiting for user to actually request the data.
      Returns:
      if true answer with 100 continue immediately after expect continue
    • requestedUriDiscovery

      public Optional<RequestedUriDiscoveryContext> requestedUriDiscovery()
      Requested URI discovery settings.
      Returns:
      settings for computing the requested URI
    • sendListeners

      public List<Http1ConnectionListener> sendListeners()
      Connection send event listeners for HTTP/1.1.
      Returns:
      send event listeners
    • receiveListeners

      public List<Http1ConnectionListener> receiveListeners()
      Connection receive event listeners for HTTP/1.1.
      Returns:
      receive event listeners
    • compositeSendListener

      public Optional<Http1ConnectionListener> compositeSendListener()
      A single send listener, this value is computed.
      Returns:
      send listener
    • compositeReceiveListener

      public Optional<Http1ConnectionListener> compositeReceiveListener()
      A single receive listener, this value is computed.
      Returns:
      receive listener
    • receiveLog

      @Deprecated(since="4.5.0", forRemoval=true) public boolean receiveLog()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Logging of received packets. Uses trace and debug levels on logger of Http1LoggingConnectionListener with suffix of .recv`.
      Returns:
      true if logging should be enabled for received packets, false if no logging should be done
    • sendLog

      @Deprecated(since="4.5.0", forRemoval=true) public boolean sendLog()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Logging of sent packets. Uses trace and debug levels on logger of Http1LoggingConnectionListener with suffix of .send`.
      Returns:
      true if logging should be enabled for sent packets, false if no logging should be done
    • toString

      public String toString()
      Overrides:
      toString in class HttpConfig.BuilderBase<BUILDER extends Http1Config.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Http1Config>
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
      Overrides:
      preBuildPrototype in class HttpConfig.BuilderBase<BUILDER extends Http1Config.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Http1Config>
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.
      Overrides:
      validatePrototype in class HttpConfig.BuilderBase<BUILDER extends Http1Config.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends Http1Config>