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

java.lang.Object
io.helidon.webserver.http.AltSvcConfig.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>
Direct Known Subclasses:
AltSvcConfig.Builder
Enclosing interface:
AltSvcConfig

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

    • BuilderBase

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

    • from

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

      public BUILDER enabled(boolean enabled)
      Whether the alternative service should be advertised.
      Parameters:
      enabled - whether advertisement is enabled
      Returns:
      updated builder instance
      See Also:
    • protocol

      public BUILDER protocol(String protocol)
      Advertised protocol name. Each Java character in the range U+0000 through U+00FF maps one-to-one to an opaque protocol identifier byte. When advertisement is enabled, the identifier must contain between 1 and 255 bytes, inclusive. Whitespace-only identifiers are valid.
      Parameters:
      protocol - advertised protocol
      Returns:
      updated builder instance
      See Also:
    • clearPort

      public BUILDER clearPort()
      Clear existing value of port.
      Returns:
      updated builder instance
      See Also:
    • port

      public BUILDER port(int port)
      Advertised port. The port must be between 1 and 65535, inclusive, when advertisement is enabled. If not configured, the local port of a port-capable binding is used. A binding without a valid port, such as a Unix domain socket binding, does not emit the configured advertisement unless an explicit port is configured.
      Parameters:
      port - advertised port
      Returns:
      updated builder instance
      See Also:
    • clearMaxAge

      public BUILDER clearMaxAge()
      Clear existing value of maxAge.
      Returns:
      updated builder instance
      See Also:
    • maxAge

      public BUILDER maxAge(Duration maxAge)
      Advertised maximum age. The maximum age must be non-negative when advertisement is enabled.
      Parameters:
      maxAge - maximum age
      Returns:
      updated builder instance
      See Also:
    • persist

      public BUILDER persist(boolean persist)
      Whether to emit the persist=1 parameter.
      Parameters:
      persist - whether to emit persist
      Returns:
      updated builder instance
      See Also:
    • enabled

      public boolean enabled()
      Whether the alternative service should be advertised.
      Returns:
      whether advertisement is enabled
    • protocol

      public String protocol()
      Advertised protocol name. Each Java character in the range U+0000 through U+00FF maps one-to-one to an opaque protocol identifier byte. When advertisement is enabled, the identifier must contain between 1 and 255 bytes, inclusive. Whitespace-only identifiers are valid.
      Returns:
      advertised protocol
    • port

      public Optional<Integer> port()
      Advertised port. The port must be between 1 and 65535, inclusive, when advertisement is enabled. If not configured, the local port of a port-capable binding is used. A binding without a valid port, such as a Unix domain socket binding, does not emit the configured advertisement unless an explicit port is configured.
      Returns:
      advertised port
    • maxAge

      public Optional<Duration> maxAge()
      Advertised maximum age. The maximum age must be non-negative when advertisement is enabled.
      Returns:
      maximum age
    • persist

      public boolean persist()
      Whether to emit the persist=1 parameter.
      Returns:
      whether to emit persist
    • 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