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
Modifier and TypeClassDescriptionprotected static class
Generated 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
-
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).boolean
details()
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 void
Handles providers and decorators.toString()
boolean
Whether to use services discovered byServiceLoader
.useSystemServices
(boolean useSystemServices) Whether to use services discovered byServiceLoader
.protected void
Validates required properties.Methods inherited from class io.helidon.webserver.observe.ObserverConfigBase.BuilderBase
enabled, enabled, from, from, name, name
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.helidon.builder.api.Prototype.Builder
buildPrototype, self
Methods 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. 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:
config
in interfacePrototype.ConfiguredBuilder<BUILDER extends HealthObserverConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends HealthObserverConfig> - Overrides:
config
in 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_204
for success,Status.SERVICE_UNAVAILABLE_503
for health down, andStatus.INTERNAL_SERVER_ERROR_500
in case of error with no entity. When details are enabled, health returnsStatus.OK_200
for success, same codes otherwise and a JSON entity with detailed information about each health check executed.- Parameters:
details
- set totrue
to 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, allHealthCheckProvider
based health checks are added.- Parameters:
useSystemServices
- set tofalse
to 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_204
for success,Status.SERVICE_UNAVAILABLE_503
for health down, andStatus.INTERNAL_SERVER_ERROR_500
in case of error with no entity. When details are enabled, health returnsStatus.OK_200
for 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, allHealthCheckProvider
based health checks are added.- Returns:
- the use system services
-
config
If this instance was configured, this would be the config instance used.- Overrides:
config
in 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:
toString
in classObserverConfigBase.BuilderBase<BUILDER extends HealthObserverConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends HealthObserverConfig>
-
preBuildPrototype
protected void preBuildPrototype()Handles providers and decorators.- Overrides:
preBuildPrototype
in classObserverConfigBase.BuilderBase<BUILDER extends HealthObserverConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends HealthObserverConfig>
-
validatePrototype
protected void validatePrototype()Validates required properties.- Overrides:
validatePrototype
in classObserverConfigBase.BuilderBase<BUILDER extends HealthObserverConfig.BuilderBase<BUILDER,
PROTOTYPE>, PROTOTYPE extends HealthObserverConfig>
-