Class HealthAggregator
java.lang.Object
org.apache.juneau.rest.server.health.HealthAggregator
Shared health-probe aggregation worker bean.
Holds the capability logic for evaluating HealthIndicator beans and summarizing them into a
probe response. The HealthServlet (servlet flavor) and HealthMixin (mixin flavor) are
independent @Rest classes that each delegate to a HealthAggregator, so the two
deployment forms cannot drift.
- Since:
- 10.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classComponent payload in the response.static classProbe response payload. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaggregate(RestContext context, Map<String, HealthIndicator> indicators, HealthProbe probe, RestResponse res) Evaluates the supplied indicators, summarizes their statuses, and sets the response status.indicators(RestContext context) Resolves theHealthIndicatorbeans registered in the given context's bean store.
-
Constructor Details
-
HealthAggregator
public HealthAggregator()
-
-
Method Details
-
indicators
Resolves theHealthIndicatorbeans registered in the given context's bean store.- Parameters:
context- The REST context whose bean store supplies the indicators.- Returns:
- The indicator beans keyed by bean name.
-
aggregate
public HealthAggregator.HealthResponse aggregate(RestContext context, Map<String, HealthIndicator> indicators, HealthProbe probe, RestResponse res) Evaluates the supplied indicators, summarizes their statuses, and sets the response status.- Parameters:
context- The REST context (supplies theHealthProbeSettingstimeout).indicators- The indicators to evaluate.probe- The probe filter, ornullto evaluate all indicators.res- The response whose status code is set (200 healthy, 503 down).- Returns:
- The aggregated health payload.
-