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

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

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

    • BuilderBase

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

    • from

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

      public BUILDER followRedirects(boolean followRedirects)
      Whether to follow redirects.
      Parameters:
      followRedirects - whether to follow redirects
      Returns:
      updated builder instance
      See Also:
    • maxRedirects

      public BUILDER maxRedirects(int maxRedirects)
      Max number of followed redirects. This is ignored if followRedirects() option is false.
      Parameters:
      maxRedirects - max number of followed redirects
      Returns:
      updated builder instance
      See Also:
    • tls

      public BUILDER tls(Tls tls)
      TLS configuration for any TLS request from this client. TLS can also be configured per request. TLS is used when the protocol is set to https.
      Parameters:
      tls - TLS configuration to use
      Returns:
      updated builder instance
      See Also:
    • tls

      public BUILDER tls(TlsConfig tlsConfig)
      TLS configuration for any TLS request from this client. TLS can also be configured per request. TLS is used when the protocol is set to https.
      Parameters:
      tlsConfig - TLS configuration to use
      Returns:
      updated builder instance
      See Also:
    • tls

      public BUILDER tls(Consumer<TlsConfig.Builder> consumer)
      TLS configuration for any TLS request from this client. TLS can also be configured per request. TLS is used when the protocol is set to https.
      Parameters:
      consumer - consumer of builder for TLS configuration to use
      Returns:
      updated builder instance
      See Also:
    • tls

      public BUILDER tls(Supplier<? extends Tls> supplier)
      TLS configuration for any TLS request from this client. TLS can also be configured per request. TLS is used when the protocol is set to https.
      Parameters:
      supplier - supplier of TLS configuration to use
      Returns:
      updated builder instance
      See Also:
    • clearReadTimeout

      public BUILDER clearReadTimeout()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • readTimeout

      public BUILDER readTimeout(Duration readTimeout)
      Read timeout.
      Parameters:
      readTimeout - read timeout
      Returns:
      updated builder instance
      See Also:
    • clearConnectTimeout

      public BUILDER clearConnectTimeout()
      Clear existing value of this property.
      Returns:
      updated builder instance
      See Also:
    • connectTimeout

      public BUILDER connectTimeout(Duration connectTimeout)
      Connect timeout.
      Parameters:
      connectTimeout - connect timeout
      Returns:
      updated builder instance
      See Also:
    • keepAlive

      public BUILDER keepAlive(boolean keepAlive)
      Determines if connection keep alive is enabled (NOT socket keep alive, but HTTP connection keep alive, to re-use the same connection for multiple requests).
      Parameters:
      keepAlive - keep alive for this connection
      Returns:
      updated builder instance
      See Also:
    • proxy

      public BUILDER proxy(Proxy proxy)
      Proxy configuration to be used for requests.
      Parameters:
      proxy - proxy to use, defaults to Proxy.noProxy()
      Returns:
      updated builder instance
      See Also:
    • proxy

      public BUILDER proxy(Consumer<Proxy.Builder> consumer)
      Proxy configuration to be used for requests.
      Parameters:
      consumer - consumer of builder for proxy to use, defaults to Proxy.noProxy()
      Returns:
      updated builder instance
      See Also:
    • proxy

      public BUILDER proxy(Supplier<? extends Proxy> supplier)
      Proxy configuration to be used for requests.
      Parameters:
      supplier - supplier of proxy to use, defaults to Proxy.noProxy()
      Returns:
      updated builder instance
      See Also:
    • properties

      public BUILDER properties(Map<? extends String,? extends String> properties)
      This method replaces all values with the new ones.
      Parameters:
      properties - map of client properties
      Returns:
      updated builder instance
      See Also:
    • addProperties

      public BUILDER addProperties(Map<? extends String,? extends String> properties)
      This method keeps existing values, then puts all new values into the map.
      Parameters:
      properties - map of client properties
      Returns:
      updated builder instance
      See Also:
    • putProperty

      public BUILDER putProperty(String key, String property)
      This method adds a new value to the map, or replaces it if the key already exists.
      Parameters:
      key - key to add or replace
      property - new value for the key
      Returns:
      updated builder instance
      See Also:
    • followRedirects

      public boolean followRedirects()
      Whether to follow redirects.
      Returns:
      the follow redirects
    • maxRedirects

      public int maxRedirects()
      Max number of followed redirects. This is ignored if followRedirects() option is false.
      Returns:
      the max redirects
    • tls

      public Optional<Tls> tls()
      TLS configuration for any TLS request from this client. TLS can also be configured per request. TLS is used when the protocol is set to https.
      Returns:
      the tls
    • readTimeout

      public Optional<Duration> readTimeout()
      Read timeout.
      Returns:
      the read timeout
      See Also:
      • SocketOptionsBlueprint.readTimeout()
    • connectTimeout

      public Optional<Duration> connectTimeout()
      Connect timeout.
      Returns:
      the connect timeout
      See Also:
      • SocketOptionsBlueprint.connectTimeout()
    • keepAlive

      public boolean keepAlive()
      Determines if connection keep alive is enabled (NOT socket keep alive, but HTTP connection keep alive, to re-use the same connection for multiple requests).
      Returns:
      the keep alive
      See Also:
    • proxy

      public Optional<Proxy> proxy()
      Proxy configuration to be used for requests.
      Returns:
      the proxy
    • properties

      public Map<String,String> properties()
      Properties configured for this client. These properties are propagated through client request, to be used by services (and possibly for other purposes).
      Returns:
      the properties
    • 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.