Class HealthObserverConfig.BuilderBase<BUILDER extends HealthObserverConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends HealthObserverConfig>
java.lang.Object
io.helidon.webserver.observe.ObserverConfigBase.BuilderBase<BUILDER,PROTOTYPE>
io.helidon.webserver.observe.health.HealthObserverConfig.BuilderBase<BUILDER,PROTOTYPE>
- Type Parameters:
BUILDER- type of the builder extending this abstract builderPROTOTYPE- type of the prototype interface that would be built byPrototype.Builder.buildPrototype()
- All Implemented Interfaces:
Prototype.Builder<BUILDER,,PROTOTYPE> Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
- Direct Known Subclasses:
HealthObserverConfig.Builder
- Enclosing interface:
HealthObserverConfig
public abstract static class HealthObserverConfig.BuilderBase<BUILDER extends HealthObserverConfig.BuilderBase<BUILDER,PROTOTYPE>,PROTOTYPE extends HealthObserverConfig>
extends ObserverConfigBase.BuilderBase<BUILDER,PROTOTYPE>
implements Prototype.ConfiguredBuilder<BUILDER,PROTOTYPE>
Fluent API builder base for
HealthObserver.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations.Nested classes/interfaces inherited from class io.helidon.webserver.observe.ObserverConfigBase.BuilderBase
ObserverConfigBase.BuilderBase.ObserverConfigBaseImpl -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddCheck(HealthCheck check) Health checks with implicit types.addCheck(HealthCheck check, HealthCheckType type) Add the provided health check using an explicit type (may differ from theHealthCheck.type().addCheck(Supplier<HealthCheckResponse> responseSupplier, HealthCheckType type, String name) Add a health check using the provided response supplier, type, and name.addChecks(HealthCheck[] checks) Add the provided health checks.addHealthChecks(List<? extends HealthCheck> healthChecks) Health checks with implicit types.config()If this instance was configured, this would be the config instance used.Update builder from configuration (node of this type).booleandetails()Whether details should be printed.details(boolean details) Whether details should be printed.endpoint()from(HealthObserverConfig prototype) Update this builder from an existing prototype instance.from(HealthObserverConfig.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.Health checks with implicit types.healthChecks(List<? extends HealthCheck> healthChecks) Health checks with implicit types.protected voidHandles providers and decorators.toString()booleanWhether to use services discovered byServiceLoader.useSystemServices(boolean useSystemServices) Whether to use services discovered byServiceLoader.protected voidValidates required properties.Methods inherited from class io.helidon.webserver.observe.ObserverConfigBase.BuilderBase
enabled, enabled, from, from, name, nameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, selfMethods inherited from interface io.helidon.builder.api.Prototype.ConfiguredBuilder
discoverService, discoverServices
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
Update this builder from an existing prototype instance.- Parameters:
prototype- existing prototype to update this builder from- Returns:
- updated builder instance
-
from
Update this builder from an existing prototype builder instance.- Parameters:
builder- existing builder prototype to update this builder from- Returns:
- updated builder instance
-
addCheck
Add the provided health check using an explicit type (may differ from theHealthCheck.type().- Parameters:
check- health check to addtype- type to use- Returns:
- updated builder instance
-
addCheck
public BUILDER addCheck(Supplier<HealthCheckResponse> responseSupplier, HealthCheckType type, String name) Add a health check using the provided response supplier, type, and name.- Parameters:
responseSupplier- supplier of the health check responsetype- type to usename- name to use for the health check- Returns:
- updated builder instance
-
addChecks
Add the provided health checks.- Parameters:
checks- health checks to add- Returns:
- updated builder instance
-
config
Update builder from configuration (node of this type). If a value is present in configuration, it would override currently configured values.- Specified by:
configin interfacePrototype.ConfiguredBuilder<BUILDER extends HealthObserverConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends HealthObserverConfig> - Overrides:
configin classObserverConfigBase.BuilderBase<BUILDER extends HealthObserverConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends HealthObserverConfig> - Parameters:
config- configuration instance used to obtain values to update this builder- Returns:
- updated builder instance
-
endpoint
- Parameters:
endpoint-- Returns:
- updated builder instance
- See Also:
-
details
Whether details should be printed. By default, health only returns aStatus.NO_CONTENT_204for success,Status.SERVICE_UNAVAILABLE_503for health down, andStatus.INTERNAL_SERVER_ERROR_500in case of error with no entity. When details are enabled, health returnsStatus.OK_200for success, same codes otherwise and a JSON entity with detailed information about each health check executed.- Parameters:
details- set totrueto enable details- Returns:
- updated builder instance
- See Also:
-
healthChecks
Health checks with implicit types.- Parameters:
healthChecks- health checks to register with the observer- Returns:
- updated builder instance
- See Also:
-
addHealthChecks
Health checks with implicit types.- Parameters:
healthChecks- health checks to register with the observer- Returns:
- updated builder instance
- See Also:
-
addCheck
Health checks with implicit types.- Parameters:
check- health checks to register with the observer- Returns:
- updated builder instance
- See Also:
-
useSystemServices
Whether to use services discovered byServiceLoader. By default, allHealthCheckProviderbased health checks are added.- Parameters:
useSystemServices- set tofalseto disable discovery- Returns:
- updated builder instance
- See Also:
-
endpoint
- Returns:
- the endpoint
-
details
public boolean details()Whether details should be printed. By default, health only returns aStatus.NO_CONTENT_204for success,Status.SERVICE_UNAVAILABLE_503for health down, andStatus.INTERNAL_SERVER_ERROR_500in case of error with no entity. When details are enabled, health returnsStatus.OK_200for success, same codes otherwise and a JSON entity with detailed information about each health check executed.- Returns:
- the details
-
healthChecks
Health checks with implicit types.- Returns:
- the health checks
-
useSystemServices
public boolean useSystemServices()Whether to use services discovered byServiceLoader. By default, allHealthCheckProviderbased health checks are added.- Returns:
- the use system services
-
config
If this instance was configured, this would be the config instance used.- Overrides:
configin classObserverConfigBase.BuilderBase<BUILDER extends HealthObserverConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends HealthObserverConfig> - Returns:
- config node used to configure this builder, or empty if not configured
-
toString
- Overrides:
toStringin classObserverConfigBase.BuilderBase<BUILDER extends HealthObserverConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends HealthObserverConfig>
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators.- Overrides:
preBuildPrototypein classObserverConfigBase.BuilderBase<BUILDER extends HealthObserverConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends HealthObserverConfig>
-
validatePrototype
protected void validatePrototype()Validates required properties.- Overrides:
validatePrototypein classObserverConfigBase.BuilderBase<BUILDER extends HealthObserverConfig.BuilderBase<BUILDER,PROTOTYPE>, PROTOTYPE extends HealthObserverConfig>
-