/** * Return the {@link Health} of a particular {@code instance} managed by the specified * {@code component} or {@code null} if that particular component is not a * {@link CompositeHealthIndicator} or if such instance does not exist. * @param component the name of a particular {@link CompositeHealthIndicator} * @param instance the name of an instance managed by that component * @return the {@link Health} for the component instance of {@code null} */ @ReadOperation public Health healthForComponentInstance(@Selector String component, @Selector String instance) { HealthIndicator indicator = getNestedHealthIndicator(this.healthIndicator, component); HealthIndicator nestedIndicator = getNestedHealthIndicator(indicator, instance); return (nestedIndicator != null) ? nestedIndicator.health() : null; }
/** * Return the {@link Health} of a particular component or {@code null} if such * component does not exist. * @param component the name of a particular {@link HealthIndicator} * @return the {@link Health} for the component or {@code null} */ @ReadOperation public Health healthForComponent(@Selector String component) { HealthIndicator indicator = getNestedHealthIndicator(this.healthIndicator, component); return (indicator != null) ? indicator.health() : null; }