@ -134,8 +134,8 @@ abstract class HealthEndpointSupport<C, T> {
protected final CompositeHealth getCompositeHealth ( ApiVersion apiVersion , Map < String , HealthComponent > components ,
protected final CompositeHealth getCompositeHealth ( ApiVersion apiVersion , Map < String , HealthComponent > components ,
StatusAggregator statusAggregator , boolean showComponents , Set < String > groupNames ) {
StatusAggregator statusAggregator , boolean showComponents , Set < String > groupNames ) {
Status status = statusAggregator . getAggregateStatus (
Status status = statusAggregator
components . values ( ) . stream ( ) . map ( HealthComponent : : getStatus ) . collect ( Collectors . toSet ( ) ) ) ;
. getAggregateStatus ( components . values ( ) . stream ( ) . map ( this : : getStatus ) . collect ( Collectors . toSet ( ) ) ) ;
Map < String , HealthComponent > instances = showComponents ? components : null ;
Map < String , HealthComponent > instances = showComponents ? components : null ;
if ( groupNames ! = null ) {
if ( groupNames ! = null ) {
return new SystemHealth ( apiVersion , status , instances , groupNames ) ;
return new SystemHealth ( apiVersion , status , instances , groupNames ) ;
@ -143,6 +143,10 @@ abstract class HealthEndpointSupport<C, T> {
return new CompositeHealth ( apiVersion , status , instances ) ;
return new CompositeHealth ( apiVersion , status , instances ) ;
}
}
private Status getStatus ( HealthComponent component ) {
return ( component ! = null ) ? component . getStatus ( ) : Status . UNKNOWN ;
}
/ * *
/ * *
* A health result containing health and the group that created it .
* A health result containing health and the group that created it .
*
*