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

java.lang.Object
io.helidon.webserver.observe.log.LogStreamConfig.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>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Direct Known Subclasses:
LogStreamConfig.Builder
Enclosing interface:
LogStreamConfig

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

    • BuilderBase

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

    • from

      public BUILDER from(LogStreamConfig 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(LogStreamConfig.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

      @Deprecated 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 ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends LogStreamConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends LogStreamConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      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 ConfigBuilderSupport.ConfiguredBuilder<BUILDER extends LogStreamConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends LogStreamConfig>
      Parameters:
      config - configuration instance used to obtain values to update this builder
      Returns:
      updated builder instance
    • enabled

      public BUILDER enabled(boolean enabled)
      Whether stream is enabled.
      Parameters:
      enabled - whether to allow streaming of log statements
      Returns:
      updated builder instance
      See Also:
    • contentType

      public BUILDER contentType(HttpMediaType contentType)
      ContentType option.
      Parameters:
      contentType - the contentType option
      Returns:
      updated builder instance
      See Also:
    • contentType

      public BUILDER contentType(Consumer<HttpMediaType.Builder> consumer)
      ContentType option.
      Parameters:
      consumer - consumer of builder of the contentType option
      Returns:
      updated builder instance
      See Also:
    • contentType

      public BUILDER contentType(Supplier<? extends HttpMediaType> supplier)
      ContentType option.
      Parameters:
      supplier - supplier of the contentType option
      Returns:
      updated builder instance
      See Also:
    • idleMessageTimeout

      public BUILDER idleMessageTimeout(Duration idleMessageTimeout)
      How long to wait before we send the idle message, to make sure we keep the stream alive.
      Parameters:
      idleMessageTimeout - if no messages appear within this duration, and idle message will be sent
      Returns:
      updated builder instance
      See Also:
    • queueSize

      public BUILDER queueSize(int queueSize)
      Length of the in-memory queue that buffers log messages from loggers before sending them over the network. If the messages are produced faster than we can send them to client, excess messages are DISCARDED, and will not be sent.
      Parameters:
      queueSize - size of the in-memory queue for log messages
      Returns:
      updated builder instance
      See Also:
    • idleString

      public BUILDER idleString(String idleString)
      String sent when there are no log messages within the idleMessageTimeout().
      Parameters:
      idleString - string to write over the network when no log messages are received
      Returns:
      updated builder instance
      See Also:
    • enabled

      public boolean enabled()
      Whether stream is enabled.
      Returns:
      whether to allow streaming of log statements
    • contentType

      public HttpMediaType contentType()
      ContentType option.
      Returns:
      the contentType option
    • idleMessageTimeout

      public Duration idleMessageTimeout()
      How long to wait before we send the idle message, to make sure we keep the stream alive.
      Returns:
      if no messages appear within this duration, and idle message will be sent
      See Also:
    • queueSize

      public int queueSize()
      Length of the in-memory queue that buffers log messages from loggers before sending them over the network. If the messages are produced faster than we can send them to client, excess messages are DISCARDED, and will not be sent.
      Returns:
      size of the in-memory queue for log messages
    • idleString

      public String idleString()
      String sent when there are no log messages within the idleMessageTimeout().
      Returns:
      string to write over the network when no log messages are received
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • preBuildPrototype

      protected void preBuildPrototype()
      Handles providers and decorators.
    • validatePrototype

      protected void validatePrototype()
      Validates required properties.
    • config

      protected Optional<Config> config()
      Configuration used to configure this instance.
      Returns:
      config instance