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

java.lang.Object
io.helidon.webclient.http2.Http2ClientProtocolConfig.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:
Http2ClientProtocolConfig.Builder
Enclosing interface:
Http2ClientProtocolConfig

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

    • BuilderBase

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

    • from

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

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

      public BUILDER priorKnowledge(boolean priorKnowledge)
      Prior knowledge of HTTP/2 capabilities of the server. If server we are connecting to does not support HTTP/2 and prior knowledge is set to false, only features supported by HTTP/1 will be available and attempts to use HTTP/2 specific will throw an UnsupportedOperationException.

      Plain text connection

      If prior knowledge is set to true, we will not attempt an upgrade of connection and use prior knowledge. If prior knowledge is set to false, we will initiate an HTTP/1 connection and upgrade it to HTTP/2, if supported by the server. plaintext connection (h2c).

      TLS protected connection

      If prior knowledge is set to true, we will negotiate protocol using HTTP/2 only, failing if not supported. if prior knowledge is set to false, we will negotiate protocol using both HTTP/2 and HTTP/1, using the protocol supported by server.
      Parameters:
      priorKnowledge - whether to use prior knowledge of HTTP/2
      Returns:
      updated builder instance
      See Also:
    • maxFrameSize

      public BUILDER maxFrameSize(int maxFrameSize)
      Configure initial MAX_FRAME_SIZE setting for new HTTP/2 connections. Maximum size of data frames in bytes the client is prepared to accept from the server. Default value is 2^14(16_384).
      Parameters:
      maxFrameSize - data frame size in bytes between 2^14(16_384) and 2^24-1(16_777_215)
      Returns:
      updated builder instance
      See Also:
    • maxHeaderListSize

      public BUILDER maxHeaderListSize(long maxHeaderListSize)
      Configure initial MAX_HEADER_LIST_SIZE setting for new HTTP/2 connections. Sends to the server the maximum header field section size client is prepared to accept. Defaults to -1, which means "unconfigured".
      Parameters:
      maxHeaderListSize - units of octets
      Returns:
      updated builder instance
      See Also:
    • initialWindowSize

      public BUILDER initialWindowSize(int initialWindowSize)
      Configure INITIAL_WINDOW_SIZE setting for new HTTP/2 connections. Sends to the server the size of the largest frame payload client is willing to receive. Defaults to 65535.
      Parameters:
      initialWindowSize - units of octets
      Returns:
      updated builder instance
      See Also:
    • flowControlBlockTimeout

      public BUILDER flowControlBlockTimeout(Duration flowControlBlockTimeout)
      Timeout for blocking between windows size check iterations.
      Parameters:
      flowControlBlockTimeout - timeout
      Returns:
      updated builder instance
      See Also:
    • ping

      public BUILDER ping(boolean ping)
      Check healthiness of cached connections with HTTP/2.0 ping frame. Defaults to false.
      Parameters:
      ping - use ping if true
      Returns:
      updated builder instance
      See Also:
    • pingTimeout

      public BUILDER pingTimeout(Duration pingTimeout)
      Timeout for ping probe used for checking healthiness of cached connections. Defaults to PT0.5S, which means 500 milliseconds.
      Parameters:
      pingTimeout - timeout
      Returns:
      updated builder instance
      See Also:
    • name

      public String name()
      Returns:
      the name
    • priorKnowledge

      public boolean priorKnowledge()
      Prior knowledge of HTTP/2 capabilities of the server. If server we are connecting to does not support HTTP/2 and prior knowledge is set to false, only features supported by HTTP/1 will be available and attempts to use HTTP/2 specific will throw an UnsupportedOperationException.

      Plain text connection

      If prior knowledge is set to true, we will not attempt an upgrade of connection and use prior knowledge. If prior knowledge is set to false, we will initiate an HTTP/1 connection and upgrade it to HTTP/2, if supported by the server. plaintext connection (h2c).

      TLS protected connection

      If prior knowledge is set to true, we will negotiate protocol using HTTP/2 only, failing if not supported. if prior knowledge is set to false, we will negotiate protocol using both HTTP/2 and HTTP/1, using the protocol supported by server.
      Returns:
      the prior knowledge
    • maxFrameSize

      public int maxFrameSize()
      Configure initial MAX_FRAME_SIZE setting for new HTTP/2 connections. Maximum size of data frames in bytes the client is prepared to accept from the server. Default value is 2^14(16_384).
      Returns:
      the max frame size
    • maxHeaderListSize

      public long maxHeaderListSize()
      Configure initial MAX_HEADER_LIST_SIZE setting for new HTTP/2 connections. Sends to the server the maximum header field section size client is prepared to accept. Defaults to -1, which means "unconfigured".
      Returns:
      the max header list size
    • initialWindowSize

      public int initialWindowSize()
      Configure INITIAL_WINDOW_SIZE setting for new HTTP/2 connections. Sends to the server the size of the largest frame payload client is willing to receive. Defaults to 65535.
      Returns:
      the initial window size
    • flowControlBlockTimeout

      public Duration flowControlBlockTimeout()
      Timeout for blocking between windows size check iterations.
      Returns:
      the flow control block timeout
    • ping

      public boolean ping()
      Check healthiness of cached connections with HTTP/2.0 ping frame. Defaults to false.
      Returns:
      the ping
    • pingTimeout

      public Duration pingTimeout()
      Timeout for ping probe used for checking healthiness of cached connections. Defaults to PT0.5S, which means 500 milliseconds.
      Returns:
      the ping timeout
    • 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.