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>, Prototype.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 Prototype.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

      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 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)
      Parameters:
      contentType -
      Returns:
      updated builder instance
      See Also:
    • contentType

      public BUILDER contentType(Config contentTypeConfig)
      Parameters:
      contentTypeConfig -
      Returns:
      updated builder instance
      See Also:
    • contentType

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

      public BUILDER contentType(Supplier<? extends HttpMediaType> supplier)
      Parameters:
      supplier - supplier of
      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:
      the enabled
    • contentType

      public HttpMediaType contentType()
      Returns:
      the content type
    • idleMessageTimeout

      public Duration idleMessageTimeout()
      How long to wait before we send the idle message, to make sure we keep the stream alive.
      Returns:
      the idle message timeout
      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:
      the queue size
    • idleString

      public String idleString()
      String sent when there are no log messages within the idleMessageTimeout().
      Returns:
      the idle string
    • 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.