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

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

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

    • BuilderBase

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

    • from

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

      public BUILDER name(String name)
      Name identifying this client protocol. Defaults to type.
      Parameters:
      name - name of client protocol
      Returns:
      updated builder instance
      See Also:
    • pollWaitTime

      public BUILDER pollWaitTime(Duration pollWaitTime)
      How long to wait for the next HTTP/2 data frame to arrive in underlying stream. Whether this is a fatal error or not is controlled by abortPollTimeExpired().
      Parameters:
      pollWaitTime - poll time as a duration
      Returns:
      updated builder instance
      See Also:
    • abortPollTimeExpired

      public BUILDER abortPollTimeExpired(boolean abortPollTimeExpired)
      Whether to continue retrying after a poll wait timeout expired or not. If a read operation timeouts out and this flag is set to false, the event is logged and the client will retry. Otherwise, an exception is thrown.
      Parameters:
      abortPollTimeExpired - abort timeout flag
      Returns:
      updated builder instance
      See Also:
    • heartbeatPeriod

      public BUILDER heartbeatPeriod(Duration heartbeatPeriod)
      How often to send a heartbeat (HTTP/2 ping) to check if the connection is still alive. This is useful for long-running, streaming gRPC calls. It is turned off by default but can be enabled by setting the period to a value greater than 0.
      Parameters:
      heartbeatPeriod - heartbeat period
      Returns:
      updated builder instance
      See Also:
    • initBufferSize

      public BUILDER initBufferSize(int initBufferSize)
      Initial buffer size used to serialize gRPC request payloads. Buffers shall grow according to the payload size, but setting this initial buffer size to a larger value may improve performance for certain applications.
      Parameters:
      initBufferSize - initial buffer size
      Returns:
      updated builder instance
      See Also:
    • name

      public String name()
      Name identifying this client protocol. Defaults to type.
      Returns:
      the name
    • pollWaitTime

      public Duration pollWaitTime()
      How long to wait for the next HTTP/2 data frame to arrive in underlying stream. Whether this is a fatal error or not is controlled by abortPollTimeExpired().
      Returns:
      the poll wait time
      See Also:
    • abortPollTimeExpired

      public boolean abortPollTimeExpired()
      Whether to continue retrying after a poll wait timeout expired or not. If a read operation timeouts out and this flag is set to false, the event is logged and the client will retry. Otherwise, an exception is thrown.
      Returns:
      the abort poll time expired
    • heartbeatPeriod

      public Duration heartbeatPeriod()
      How often to send a heartbeat (HTTP/2 ping) to check if the connection is still alive. This is useful for long-running, streaming gRPC calls. It is turned off by default but can be enabled by setting the period to a value greater than 0.
      Returns:
      the heartbeat period
    • initBufferSize

      public int initBufferSize()
      Initial buffer size used to serialize gRPC request payloads. Buffers shall grow according to the payload size, but setting this initial buffer size to a larger value may improve performance for certain applications.
      Returns:
      the init buffer size
    • 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.