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

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

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

    • BuilderBase

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

    • from

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

      public BUILDER cors(CrossOriginConfig cors)
      Cors support inherited by each observe provider, unless explicitly configured.
      Parameters:
      cors - cors support to use
      Returns:
      updated builder instance
      See Also:
    • cors

      public BUILDER cors(Consumer<CrossOriginConfig.Builder> consumer)
      Cors support inherited by each observe provider, unless explicitly configured.
      Parameters:
      consumer - consumer of builder for cors support to use
      Returns:
      updated builder instance
      See Also:
    • cors

      public BUILDER cors(Supplier<? extends CrossOriginConfig> supplier)
      Cors support inherited by each observe provider, unless explicitly configured.
      Parameters:
      supplier - supplier of cors support to use
      Returns:
      updated builder instance
      See Also:
    • enabled

      public BUILDER enabled(boolean enabled)
      Whether the observe support is enabled.
      Parameters:
      enabled - false to disable observe feature
      Returns:
      updated builder instance
      See Also:
    • endpoint

      public BUILDER endpoint(String endpoint)
      Root endpoint to use for observe providers. By default, all observe endpoint are under this root endpoint.

      Example:
      If root endpoint is /observe (the default), and default health endpoint is health (relative), health endpoint would be /observe/health.

      Parameters:
      endpoint - endpoint to use
      Returns:
      updated builder instance
      See Also:
    • weight

      public BUILDER weight(double weight)
      Change the weight of this feature. This may change the order of registration of this feature. By default, observability weight is 80.0 so it is registered after routing.
      Parameters:
      weight - weight to use
      Returns:
      updated builder instance
      See Also:
    • observersDiscoverServices

      public BUILDER observersDiscoverServices(boolean discoverServices)
      Observers to use with this observe features. Each observer type is registered only once, unless it uses a custom name (default name is the same as the type).
      Parameters:
      discoverServices - whether to discover implementations through service loader
      Returns:
      updated builder instance
      See Also:
    • observers

      public BUILDER observers(List<? extends Observer> observers)
      Observers to use with this observe features. Each observer type is registered only once, unless it uses a custom name (default name is the same as the type).
      Parameters:
      observers - list of observers to use in this feature
      Returns:
      updated builder instance
      See Also:
    • addObservers

      public BUILDER addObservers(List<? extends Observer> observers)
      Observers to use with this observe features. Each observer type is registered only once, unless it uses a custom name (default name is the same as the type).
      Parameters:
      observers - list of observers to use in this feature
      Returns:
      updated builder instance
      See Also:
    • addObserver

      public BUILDER addObserver(Observer observer)
      Observers to use with this observe features. Each observer type is registered only once, unless it uses a custom name (default name is the same as the type).
      Parameters:
      observer - list of observers to use in this feature
      Returns:
      updated builder instance
      See Also:
    • sockets

      public BUILDER sockets(List<? extends String> sockets)
      Sockets the observability endpoint should be exposed on. If not defined, defaults to the default socket ("@default". Each observer may have its own configuration of sockets that are relevant to it, this only controls the endpoints!
      Parameters:
      sockets - list of sockets to register observe endpoint on
      Returns:
      updated builder instance
      See Also:
    • addSockets

      public BUILDER addSockets(List<? extends String> sockets)
      Sockets the observability endpoint should be exposed on. If not defined, defaults to the default socket ("@default". Each observer may have its own configuration of sockets that are relevant to it, this only controls the endpoints!
      Parameters:
      sockets - list of sockets to register observe endpoint on
      Returns:
      updated builder instance
      See Also:
    • name

      public BUILDER name(String name)
      Name of this instance.
      Parameters:
      name - instance name
      Returns:
      updated builder instance
      See Also:
    • cors

      public CrossOriginConfig cors()
      Cors support inherited by each observe provider, unless explicitly configured.
      Returns:
      the cors
    • enabled

      public boolean enabled()
      Whether the observe support is enabled.
      Returns:
      the enabled
    • endpoint

      public String endpoint()
      Root endpoint to use for observe providers. By default, all observe endpoint are under this root endpoint.

      Example:
      If root endpoint is /observe (the default), and default health endpoint is health (relative), health endpoint would be /observe/health.

      Returns:
      the endpoint
    • weight

      public double weight()
      Change the weight of this feature. This may change the order of registration of this feature. By default, observability weight is 80.0 so it is registered after routing.
      Returns:
      the weight
    • observers

      public List<Observer> observers()
      Observers to use with this observe features. Each observer type is registered only once, unless it uses a custom name (default name is the same as the type).
      Returns:
      the observers
    • sockets

      public List<String> sockets()
      Sockets the observability endpoint should be exposed on. If not defined, defaults to the default socket ("@default". Each observer may have its own configuration of sockets that are relevant to it, this only controls the endpoints!
      Returns:
      the sockets
    • name

      public String name()
      Name of this instance.
      Returns:
      the name
    • 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.