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>, ConfigBuilderSupport.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 ConfigBuilderSupport.ConfiguredBuilder<BUILDER, PROTOTYPE>
Fluent API builder base for
HealthObserverConfig.-
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 ObserverConfigBase.BuilderBase
ObserverConfigBase.BuilderBase.ObserverConfigBaseImplModifier and TypeClassDescriptionprotected static classGenerated implementation of the prototype, can be extended by descendant prototype implementations. -
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.addExclude(List<String> exclude) Health check names to exclude in computing the overall health of the server.addExcluded(String excluded) Health check names to exclude in computing the overall health of the server.addHealthChecks(List<? extends HealthCheck> healthChecks) Health checks with implicit types.Clear all exclude.Clear all healthChecks.Update builder from configuration (node of this type).booleandetails()Whether details should be printed.details(boolean details) Whether details should be printed.endpoint()Endpoint option.Endpoint option.exclude()Health check names to exclude in computing the overall health of the server.Health check names to exclude in computing the overall health of the server.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 discovered health-check services.useSystemServices(boolean useSystemServices) Whether to use discovered health-check services.protected voidValidates required properties.Methods inherited from class ObserverConfigBase.BuilderBase
config, enabled, enabled, from, from, name, nameModifier and TypeMethodDescriptionconfig()The config instance used to configure this observer.booleanenabled()Whether this observer is enabled.enabled(boolean enabled) Whether this observer is enabled.from(ObserverConfigBase prototype) Update this builder from an existing prototype instance.from(ObserverConfigBase.BuilderBase<?, ?> builder) Update this builder from an existing prototype builder instance.name()Name of this observer.Name of this observer.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Prototype.Builder
buildPrototype, self
-
Constructor Details
-
BuilderBase
protected BuilderBase()Protected to support extensibility.
-
-
Method Details
-
from
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
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 interfaceConfigBuilderSupport.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
-
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:
-
clearHealthChecks
Clear all healthChecks.- 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- add single health checks to register with the observer- Returns:
- updated builder instance
- See Also:
-
useSystemServices
Whether to use discovered health-check services. By default, allHealthCheckProviderandHealthCheckservices are added. A directly created observer discovers services usingServiceLoaderand the global service registry. A registry-managed observer uses its owning registry.- Parameters:
useSystemServices- set tofalseto disable discovery- Returns:
- updated builder instance
- See Also:
-
clearExclude
-
exclude
-
addExclude
-
addExcluded
-
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:
- set to
trueto enable details
-
healthChecks
Health checks with implicit types.- Returns:
- health checks to register with the observer
-
useSystemServices
public boolean useSystemServices()Whether to use discovered health-check services. By default, allHealthCheckProviderandHealthCheckservices are added. A directly created observer discovers services usingServiceLoaderand the global service registry. A registry-managed observer uses its owning registry.- Returns:
- set to
falseto disable discovery
-
exclude
-
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>
-