Class HealthWebEndpointResponseMapper
- java.lang.Object
- org.springframework.boot.actuate.health.HealthWebEndpointResponseMapper
public class HealthWebEndpointResponseMapper extends Object
Maps aHealth
to aWebEndpointResponse
.- Since:
- 2.0.0
Constructor Summary
Constructors Constructor Description HealthWebEndpointResponseMapper(HealthStatusHttpMapper statusHttpMapper, ShowDetails showDetails, Set<String> authorizedRoles)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebEndpointResponse<Health>
map(Health health, SecurityContext securityContext)
Maps the givenhealth
to aWebEndpointResponse
, honouring the mapper's defaultShowDetails
using the givensecurityContext
.WebEndpointResponse<Health>
map(Health health, SecurityContext securityContext, ShowDetails showDetails)
Maps the givenhealth
to aWebEndpointResponse
, honouring the givenshowDetails
using the givensecurityContext
.WebEndpointResponse<Health>
mapDetails(Supplier<Health> health, SecurityContext securityContext)
Maps the givenhealth
details to aWebEndpointResponse
, honouring the mapper's defaultShowDetails
using the givensecurityContext
.
Constructor Detail
HealthWebEndpointResponseMapper
public HealthWebEndpointResponseMapper(HealthStatusHttpMapper statusHttpMapper, ShowDetails showDetails, Set<String> authorizedRoles)
Method Detail
mapDetails
public WebEndpointResponse<Health> mapDetails(Supplier<Health> health, SecurityContext securityContext)
Maps the givenhealth
details to aWebEndpointResponse
, honouring the mapper's defaultShowDetails
using the givensecurityContext
.If the current user does not have the right to see the details, the
Supplier
is not invoked and a 404 response is returned instead.- Parameters:
health
- the provider of health details, invoked if the current user has the right to see themsecurityContext
- the security context- Returns:
- the mapped response
map
public WebEndpointResponse<Health> map(Health health, SecurityContext securityContext)
Maps the givenhealth
to aWebEndpointResponse
, honouring the mapper's defaultShowDetails
using the givensecurityContext
.- Parameters:
health
- the health to mapsecurityContext
- the security context- Returns:
- the mapped response
map
public WebEndpointResponse<Health> map(Health health, SecurityContext securityContext, ShowDetails showDetails)
Maps the givenhealth
to aWebEndpointResponse
, honouring the givenshowDetails
using the givensecurityContext
.- Parameters:
health
- the health to mapsecurityContext
- the security contextshowDetails
- when to show details in the response- Returns:
- the mapped response