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

java.lang.Object
io.helidon.webclient.api.HttpConfigBase.BuilderBase<BUILDER,PROTOTYPE>
io.helidon.webclient.api.HttpClientConfig.BuilderBase<BUILDER,PROTOTYPE>
io.helidon.webclient.api.WebClientConfig.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:
WebClientConfig.Builder
Enclosing interface:
WebClientConfig

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

    • BuilderBase

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

    • from

      public BUILDER from(WebClientConfig 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(WebClientConfig.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 WebClientConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends WebClientConfig>
      Overrides:
      config in class HttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends WebClientConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • protocolConfigsDiscoverServices

      public BUILDER protocolConfigsDiscoverServices(boolean discoverServices)
      Configuration of client protocols.
      Parameters:
      discoverServices - whether to discover implementations through service loader
      Returns:
      updated builder instance
      See Also:
    • protocolConfigs

      public BUILDER protocolConfigs(List<? extends ProtocolConfig> protocolConfigs)
      Configuration of client protocols.
      Parameters:
      protocolConfigs - client protocol configurations
      Returns:
      updated builder instance
      See Also:
    • addProtocolConfigs

      public BUILDER addProtocolConfigs(List<? extends ProtocolConfig> protocolConfigs)
      Configuration of client protocols.
      Parameters:
      protocolConfigs - client protocol configurations
      Returns:
      updated builder instance
      See Also:
    • addProtocolConfig

      public BUILDER addProtocolConfig(ProtocolConfig protocolConfig)
      Configuration of client protocols.
      Parameters:
      protocolConfig - client protocol configurations
      Returns:
      updated builder instance
      See Also:
    • protocolPreference

      public BUILDER protocolPreference(List<? extends String> protocolPreference)
      List of HTTP protocol IDs by order of preference. If left empty, all discovered providers will be used, ordered by weight.

      For example if both HTTP/2 and HTTP/1.1 providers are available (considering HTTP/2 has higher weights), for ALPN we will send h2 and http/1.1 and decide based on response. If TLS is not used, we would attempt an upgrade (or use prior knowledge if configured in protocolConfigs()).

      Parameters:
      protocolPreference - list of HTTP protocol IDs in order of preference
      Returns:
      updated builder instance
      See Also:
    • addProtocolPreference

      public BUILDER addProtocolPreference(List<? extends String> protocolPreference)
      List of HTTP protocol IDs by order of preference. If left empty, all discovered providers will be used, ordered by weight.

      For example if both HTTP/2 and HTTP/1.1 providers are available (considering HTTP/2 has higher weights), for ALPN we will send h2 and http/1.1 and decide based on response. If TLS is not used, we would attempt an upgrade (or use prior knowledge if configured in protocolConfigs()).

      Parameters:
      protocolPreference - list of HTTP protocol IDs in order of preference
      Returns:
      updated builder instance
      See Also:
    • addProtocolPreference

      public BUILDER addProtocolPreference(String protocolPreference)
      List of HTTP protocol IDs by order of preference. If left empty, all discovered providers will be used, ordered by weight.

      For example if both HTTP/2 and HTTP/1.1 providers are available (considering HTTP/2 has higher weights), for ALPN we will send h2 and http/1.1 and decide based on response. If TLS is not used, we would attempt an upgrade (or use prior knowledge if configured in protocolConfigs()).

      Parameters:
      protocolPreference - list of HTTP protocol IDs in order of preference
      Returns:
      updated builder instance
      See Also:
    • protocolConfigs

      public List<ProtocolConfig> protocolConfigs()
      Configuration of client protocols.
      Returns:
      the protocol configs
    • protocolPreference

      public List<String> protocolPreference()
      List of HTTP protocol IDs by order of preference. If left empty, all discovered providers will be used, ordered by weight.

      For example if both HTTP/2 and HTTP/1.1 providers are available (considering HTTP/2 has higher weights), for ALPN we will send h2 and http/1.1 and decide based on response. If TLS is not used, we would attempt an upgrade (or use prior knowledge if configured in protocolConfigs()).

      Returns:
      the protocol preference
    • config

      public Optional<Config> config()
      If this instance was configured, this would be the config instance used.
      Overrides:
      config in class HttpClientConfig.BuilderBase<BUILDER extends WebClientConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends WebClientConfig>
      Returns:
      config node used to configure this builder, or empty if not configured
    • toString

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

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

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