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

java.lang.Object
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>, Prototype.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 Object implements Prototype.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

      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 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 NamedService.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:
    • validateRequestHeaders

      public BUILDER validateRequestHeaders(boolean validateRequestHeaders)
      Whether to validate headers. If set to false, any value is accepted, otherwise validates headers + known headers are validated by format (content length is always validated as it is part of protocol processing (other headers may be validated if features use them)).

      Defaults to true.

      Parameters:
      validateRequestHeaders - whether to validate headers
      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:
    • validateResponseHeaders

      public BUILDER validateResponseHeaders(boolean validateResponseHeaders)
      Whether to validate headers. If set to false, any value is accepted, otherwise validates headers + known headers are validated by format (content length is always validated as it is part of protocol processing (other headers may be validated if features use them)).

      Defaults to false as user has control on the header creation.

      Parameters:
      validateResponseHeaders - whether to validate headers
      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:
    • receiveLog

      public BUILDER receiveLog(boolean receiveLog)
      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

      public BUILDER sendLog(boolean sendLog)
      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:
    • 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 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:
    • 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 - send event listeners
      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 - 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:
    • name

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

      public int maxPrologueLength()
      Maximal size of received HTTP prologue (GET /path HTTP/1.1).
      Returns:
      the max prologue length
    • maxHeadersSize

      public int maxHeadersSize()
      Maximal size of received headers in bytes.
      Returns:
      the max headers size
    • validateRequestHeaders

      public boolean validateRequestHeaders()
      Whether to validate headers. If set to false, any value is accepted, otherwise validates headers + known headers are validated by format (content length is always validated as it is part of protocol processing (other headers may be validated if features use them)).

      Defaults to true.

      Returns:
      the validate request headers
    • 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:
      the validate request host header
    • validateResponseHeaders

      public boolean validateResponseHeaders()
      Whether to validate headers. If set to false, any value is accepted, otherwise validates headers + known headers are validated by format (content length is always validated as it is part of protocol processing (other headers may be validated if features use them)).

      Defaults to false as user has control on the header creation.

      Returns:
      the validate response headers
    • 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:
      the validate prologue
    • validatePath

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

      public boolean receiveLog()
      Logging of received packets. Uses trace and debug levels on logger of Http1LoggingConnectionListener with suffix of .recv`.
      Returns:
      the receive log
    • sendLog

      public boolean sendLog()
      Logging of sent packets. Uses trace and debug levels on logger of Http1LoggingConnectionListener with suffix of .send`.
      Returns:
      the send log
    • 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:
      the continue immediately
    • requestedUriDiscovery

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

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

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

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

      public Optional<Http1ConnectionListener> compositeReceiveListener()
      A single receive listener, this value is computed.
      Returns:
      the composite receive listener
    • 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.