Class CompositeHealthIndicator
- java.lang.Object
- org.springframework.boot.actuate.health.CompositeHealthIndicator
- All Implemented Interfaces:
HealthIndicator
public class CompositeHealthIndicator extends Object implements HealthIndicator
HealthIndicator
that returns health indications from all registered delegates.- Since:
- 1.1.0
Constructor Summary
Constructors Constructor Description CompositeHealthIndicator(HealthAggregator healthAggregator)
Deprecated.since 2.1.0 in favor ofCompositeHealthIndicator(HealthAggregator, HealthIndicatorRegistry)
CompositeHealthIndicator(HealthAggregator healthAggregator, Map<String,HealthIndicator> indicators)
Create a newCompositeHealthIndicator
from the specified indicators.CompositeHealthIndicator(HealthAggregator healthAggregator, HealthIndicatorRegistry registry)
Create a newCompositeHealthIndicator
from the indicators in the givenregistry
.
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addHealthIndicator(String name, HealthIndicator indicator)
Deprecated.since 2.1.0 in favor ofHealthIndicatorRegistry.register(String, HealthIndicator)
HealthIndicatorRegistry
getRegistry()
Return theHealthIndicatorRegistry
of this instance.Health
health()
Return an indication of health.
Constructor Detail
CompositeHealthIndicator
@Deprecated public CompositeHealthIndicator(HealthAggregator healthAggregator)
Deprecated.since 2.1.0 in favor ofCompositeHealthIndicator(HealthAggregator, HealthIndicatorRegistry)
Create a newCompositeHealthIndicator
.- Parameters:
healthAggregator
- the health aggregator
CompositeHealthIndicator
public CompositeHealthIndicator(HealthAggregator healthAggregator, Map<String,HealthIndicator> indicators)
Create a newCompositeHealthIndicator
from the specified indicators.- Parameters:
healthAggregator
- the health aggregatorindicators
- a map ofHealthIndicators
with the key being used as an indicator name.
CompositeHealthIndicator
public CompositeHealthIndicator(HealthAggregator healthAggregator, HealthIndicatorRegistry registry)
Create a newCompositeHealthIndicator
from the indicators in the givenregistry
.- Parameters:
healthAggregator
- the health aggregatorregistry
- the registry ofHealthIndicators
.
Method Detail
addHealthIndicator
@Deprecated public void addHealthIndicator(String name, HealthIndicator indicator)
Deprecated.since 2.1.0 in favor ofHealthIndicatorRegistry.register(String, HealthIndicator)
Adds the givenhealthIndicator
, associating it with the givenname
.- Parameters:
name
- the name of the indicatorindicator
- the indicator- Throws:
IllegalStateException
- if an indicator with the givenname
is already registered.
getRegistry
public HealthIndicatorRegistry getRegistry()
Return theHealthIndicatorRegistry
of this instance.- Returns:
- the registry of nested
health indicators
- Since:
- 2.1.0
health
public Health health()
Description copied from interface:HealthIndicator
Return an indication of health.- Specified by:
health
in interfaceHealthIndicator
- Returns:
- the health for