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

java.lang.Object
io.helidon.webserver.ConnectionConfig.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:
ConnectionConfig.Builder
Enclosing interface:
ConnectionConfig

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

    • BuilderBase

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

    • from

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

      public BUILDER readTimeout(Duration readTimeout)
      Read timeout. Default is "PT30S"
      Parameters:
      readTimeout - read timeout
      Returns:
      updated builder instance
      See Also:
    • connectTimeout

      public BUILDER connectTimeout(Duration connectTimeout)
      Connect timeout. Default is "PT10S".
      Parameters:
      connectTimeout - connect timeout
      Returns:
      updated builder instance
      See Also:
    • sendBufferSize

      public BUILDER sendBufferSize(int sendBufferSize)
      Socket send buffer size. Default is 32768.
      Parameters:
      sendBufferSize - buffer size, in bytes
      Returns:
      updated builder instance
      See Also:
    • receiveBufferSize

      public BUILDER receiveBufferSize(int receiveBufferSize)
      Socket receive buffer size. Default is 32768.
      Parameters:
      receiveBufferSize - buffer size, in bytes
      Returns:
      updated builder instance
      See Also:
    • keepAlive

      public BUILDER keepAlive(boolean keepAlive)
      Configure socket keep alive. Default is true.
      Parameters:
      keepAlive - keep alive
      Returns:
      updated builder instance
      See Also:
    • reuseAddress

      public BUILDER reuseAddress(boolean reuseAddress)
      Socket reuse address. Default is true.
      Parameters:
      reuseAddress - whether to reuse address
      Returns:
      updated builder instance
      See Also:
    • tcpNoDelay

      public BUILDER tcpNoDelay(boolean tcpNoDelay)
      Disable Nagle's algorithm by setting TCP_NODELAY to true. This can result in better performance on Mac or newer linux kernels for some payload types. Default is false.
      Parameters:
      tcpNoDelay - whether to use TCP_NODELAY, defaults to false
      Returns:
      updated builder instance
      See Also:
    • socketOptions

      public BUILDER socketOptions(Map<SocketOption<?>,?> socketOptions)
      This method replaces all values with the new ones.
      Parameters:
      socketOptions - socket options
      Returns:
      updated builder instance
      See Also:
    • addSocketOptions

      public BUILDER addSocketOptions(Map<SocketOption<?>,?> socketOptions)
      This method keeps existing values, then puts all new values into the map.
      Parameters:
      socketOptions - socket options
      Returns:
      updated builder instance
      See Also:
    • putSocketOption

      public BUILDER putSocketOption(SocketOption<?> key, Object socketOption)
      This method adds a new value to the map, or replaces it if the key already exists.
      Parameters:
      key - key to add or replace
      socketOption - new value for the key
      Returns:
      updated builder instance
      See Also:
    • readTimeout

      public Duration readTimeout()
      Read timeout. Default is "PT30S"
      Returns:
      the read timeout
    • connectTimeout

      public Duration connectTimeout()
      Connect timeout. Default is "PT10S".
      Returns:
      the connect timeout
    • sendBufferSize

      public int sendBufferSize()
      Socket send buffer size. Default is 32768.
      Returns:
      the send buffer size
      See Also:
    • receiveBufferSize

      public int receiveBufferSize()
      Socket receive buffer size. Default is 32768.
      Returns:
      the receive buffer size
      See Also:
    • keepAlive

      public boolean keepAlive()
      Configure socket keep alive. Default is true.
      Returns:
      the keep alive
      See Also:
    • reuseAddress

      public boolean reuseAddress()
      Socket reuse address. Default is true.
      Returns:
      the reuse address
      See Also:
    • tcpNoDelay

      public boolean tcpNoDelay()
      Disable Nagle's algorithm by setting TCP_NODELAY to true. This can result in better performance on Mac or newer linux kernels for some payload types. Default is false.
      Returns:
      the tcp no delay
      See Also:
    • socketOptions

      public Map<SocketOption<?>,Object> socketOptions()
      Set an arbitrary socket option. A mapping of a socket option to its value. Socket options may be system specific. Most commonly supported socket options are available as methods directly.
      Returns:
      the socket options
      See Also:
    • 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.