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>, ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>, ConfigBuilderSupport.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 ConfigBuilderSupport.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for ObserveFeatureConfig.
  • 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

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

      @Deprecated(since="4.4.0", forRemoval=true) public BUILDER cors(CrossOriginConfig cors)
      Deprecated, for removal: This API element is subject to removal in a future version.
      feature specific CORS configuration is deprecated and will be removed; use either config based CORS setup (configuration key cors, or programmatic setup using the io.helidon.webserver.cors.CorsFeature server feature
      Cors support inherited by each observe provider, unless explicitly configured.
      Parameters:
      cors - cors support to use
      Returns:
      updated builder instance
      See Also:
    • cors

      @Deprecated(since="4.4.0", forRemoval=true) public BUILDER cors(Consumer<CrossOriginConfig.Builder> consumer)
      Deprecated, for removal: This API element is subject to removal in a future version.
      feature specific CORS configuration is deprecated and will be removed; use either config based CORS setup (configuration key cors, or programmatic setup using the io.helidon.webserver.cors.CorsFeature server feature
      Cors support inherited by each observe provider, unless explicitly configured.
      Parameters:
      consumer - consumer of builder of cors support to use
      Returns:
      updated builder instance
      See Also:
    • cors

      @Deprecated(since="4.4.0", forRemoval=true) public BUILDER cors(Supplier<? extends CrossOriginConfig> supplier)
      Deprecated, for removal: This API element is subject to removal in a future version.
      feature specific CORS configuration is deprecated and will be removed; use either config based CORS setup (configuration key cors, or programmatic setup using the io.helidon.webserver.cors.CorsFeature server feature
      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:
    • clearObservers

      public BUILDER clearObservers()
      Clear all observers.
      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 - add single list of observers to use in this feature
      Returns:
      updated builder instance
      See Also:
    • clearSockets

      public BUILDER clearSockets()
      Clear all sockets.
      Returns:
      updated builder instance
      See Also:
    • sockets

      public BUILDER sockets(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!
      Parameters:
      sockets - list of sockets to register observe endpoint on
      Returns:
      updated builder instance
      See Also:
    • addSockets

      public BUILDER addSockets(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!
      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:
    • observersDiscoverServices

      public BUILDER observersDiscoverServices(boolean observersDiscoverServices)
      Service discovery flag for observers(). If set to true, services will be discovered from Java service loader, or Helidon ServiceRegistry.
      Parameters:
      observersDiscoverServices - whether to enable automatic service discovery
      Returns:
      updated builder instance
      See Also:
    • cors

      @Deprecated(since="4.4.0", forRemoval=true) public CrossOriginConfig cors()
      Deprecated, for removal: This API element is subject to removal in a future version.
      feature specific CORS configuration is deprecated and will be removed; use either config based CORS setup (configuration key cors, or programmatic setup using the io.helidon.webserver.cors.CorsFeature server feature
      Cors support inherited by each observe provider, unless explicitly configured.
      Returns:
      cors support to use
    • enabled

      public boolean enabled()
      Whether the observe support is enabled.
      Returns:
      false to disable observe feature
    • 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:
      endpoint to use
    • 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:
      weight to use
    • 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:
      list of observers to use in this feature
    • config

      public Optional<Config> config()
      Configuration of the observe feature, if present.
      Returns:
      config node of the feature
    • 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:
      list of sockets to register observe endpoint on
    • name

      public String name()
      Name of this instance.
      Returns:
      instance name
    • observersDiscoverServices

      public boolean observersDiscoverServices()
      Service discovery flag for observers(). If set to true, services will be discovered from Java service loader, or Helidon ServiceRegistry.
      Returns:
      whether to enable automatic service discovery
    • toString

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

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

      protected void validatePrototype()
      Validates required properties.