- java.lang.Object
-
- io.helidon.health.HealthSupport.Builder
-
- All Implemented Interfaces:
Builder<HealthSupport>,Supplier<HealthSupport>
- Enclosing class:
- HealthSupport
public static final class HealthSupport.Builder extends Object implements Builder<HealthSupport>
Fluent API builder forHealthSupport.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description HealthSupport.Builderadd(HealthCheck... healthChecks)HealthSupport.BuilderaddExcluded(String healthCheckName)Add a health check to a black list.HealthSupport.BuilderaddExcluded(Collection<String> names)Add health checks to a black list.HealthSupport.BuilderaddExcludedClass(Class<?> aClass)A class may be excluded from invoking health checks on it.HealthSupport.BuilderaddIncluded(String healthCheckName)Add a health check to a white list (in caseHealthSupport.includeAllis set tofalse.HealthSupport.BuilderaddIncluded(Collection<String> names)Add health checks to a white list (in caseHealthSupport.includeAllis set tofalse.HealthSupport.BuilderaddLiveness(Collection<HealthCheck> healthChecks)Add liveness health check(s).HealthSupport.BuilderaddLiveness(HealthCheck... healthChecks)Add liveness health check(s).HealthSupport.BuilderaddReadiness(Collection<HealthCheck> healthChecks)Add readiness health check(s).HealthSupport.BuilderaddReadiness(HealthCheck... healthChecks)Add readiness health check(s).HealthSupport.BuilderbackwardCompatible(boolean enabled)Deprecated.rely on the current output formatHealthSupportbuild()Build the instance from this builder.HealthSupport.Builderconfig(Config config)Update this builder from configuration.HealthSupport.BuildercrossOriginConfig(CrossOriginConfig crossOriginConfig)Set the CORS config from the specifiedCrossOriginConfigobject.HealthSupport.Builderenabled(boolean enabled)HealthSupport can be disabled by invoking this method.HealthSupport.Buildertimeout(long timeout, TimeUnit unit)Configure overall timeout of health check call.HealthSupport.BuilderwebContext(String path)Path under which to register health check endpoint on the web server.
-
-
-
Method Detail
-
build
public HealthSupport build()
Description copied from interface:BuilderBuild the instance from this builder.- Specified by:
buildin interfaceBuilder<HealthSupport>- Returns:
- instance of the built type
-
webContext
public HealthSupport.Builder webContext(String path)
Path under which to register health check endpoint on the web server.- Parameters:
path- webContext to use, defaults to- Returns:
- updated builder instance
-
add
@Deprecated public HealthSupport.Builder add(HealthCheck... healthChecks)
Deprecated.useaddReadiness(org.eclipse.microprofile.health.HealthCheck...)oraddLiveness(org.eclipse.microprofile.health.HealthCheck...)instead. This method is needed until the microprofile specification removes support for generic HealthChecks (which are already deprecated).Add a health check (or healthchecks) to the list. All health checks would get invoked when this endpoint is called (even when the result is excluded).- Parameters:
healthChecks- health check(s) to add- Returns:
- updated builder instance
-
addIncluded
public HealthSupport.Builder addIncluded(String healthCheckName)
Add a health check to a white list (in caseHealthSupport.includeAllis set tofalse.- Parameters:
healthCheckName- name of a health check to include- Returns:
- updated builder instance
-
addIncluded
public HealthSupport.Builder addIncluded(Collection<String> names)
Add health checks to a white list (in caseHealthSupport.includeAllis set tofalse.- Parameters:
names- names of health checks to include- Returns:
- updated builder instance
-
addExcluded
public HealthSupport.Builder addExcluded(String healthCheckName)
Add a health check to a black list. Health check results that match by name with a blacklisted records will not be part of the result.- Parameters:
healthCheckName- name of a health check to exclude- Returns:
- updated builder instance
-
addExcluded
public HealthSupport.Builder addExcluded(Collection<String> names)
Add health checks to a black list. Health check results that match by name with a blacklisted records will not be part of the result.- Parameters:
names- names of health checks to exclude- Returns:
- updated builder instance
-
config
public HealthSupport.Builder config(Config config)
Update this builder from configuration.- Parameters:
config- node located on this component's configuration- Returns:
- updated builder instance
-
timeout
public HealthSupport.Builder timeout(long timeout, TimeUnit unit)
Configure overall timeout of health check call.- Parameters:
timeout- timeout valueunit- timeout time unit- Returns:
- updated builder instance
-
addExcludedClass
public HealthSupport.Builder addExcludedClass(Class<?> aClass)
A class may be excluded from invoking health checks on it. This allows configurable approach to disabling broken health-checks.- Parameters:
aClass- class to ignore (any health check instance of this class will be ignored)- Returns:
- updated builder instance
-
addLiveness
public HealthSupport.Builder addLiveness(HealthCheck... healthChecks)
Add liveness health check(s).- Parameters:
healthChecks- health check(s) to add- Returns:
- updated builder instance
-
addLiveness
public HealthSupport.Builder addLiveness(Collection<HealthCheck> healthChecks)
Add liveness health check(s).- Parameters:
healthChecks- health checks to add- Returns:
- updated builder instance
-
addReadiness
public HealthSupport.Builder addReadiness(HealthCheck... healthChecks)
Add readiness health check(s).- Parameters:
healthChecks- health checks to add- Returns:
- updated builder instance
-
addReadiness
public HealthSupport.Builder addReadiness(Collection<HealthCheck> healthChecks)
Add readiness health check(s).- Parameters:
healthChecks- health checks to add- Returns:
- updated builder instance
-
enabled
public HealthSupport.Builder enabled(boolean enabled)
HealthSupport can be disabled by invoking this method.- Parameters:
enabled- whether to enable the health support (defaults totrue)- Returns:
- updated builder instance
-
backwardCompatible
@Deprecated public HealthSupport.Builder backwardCompatible(boolean enabled)
Deprecated.rely on the current output formatBackward compatibility flag to produce Health 1.X compatible JSON output (including "outcome" property).- Parameters:
enabled- whether to enable backward compatible mode (defaults totrue)- Returns:
- updated builder instance
-
crossOriginConfig
public HealthSupport.Builder crossOriginConfig(CrossOriginConfig crossOriginConfig)
Set the CORS config from the specifiedCrossOriginConfigobject.- Parameters:
crossOriginConfig-CrossOriginConfigcontaining CORS set-up- Returns:
- updated builder instance
-
-