Class HealthWebEndpointResponseMapper
- java.lang.Object
- org.springframework.boot.actuate.health.HealthWebEndpointResponseMapper
public class HealthWebEndpointResponseMapper extends Object
Maps aHealthto 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 givenhealthto aWebEndpointResponse, honouring the mapper's defaultShowDetailsusing the givensecurityContext.WebEndpointResponse<Health>map(Health health, SecurityContext securityContext, ShowDetails showDetails)Maps the givenhealthto aWebEndpointResponse, honouring the givenshowDetailsusing the givensecurityContext.WebEndpointResponse<Health>mapDetails(Supplier<Health> health, SecurityContext securityContext)Maps the givenhealthdetails to aWebEndpointResponse, honouring the mapper's defaultShowDetailsusing 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 givenhealthdetails to aWebEndpointResponse, honouring the mapper's defaultShowDetailsusing the givensecurityContext.If the current user does not have the right to see the details, the
Supplieris 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 givenhealthto aWebEndpointResponse, honouring the mapper's defaultShowDetailsusing 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 givenhealthto aWebEndpointResponse, honouring the givenshowDetailsusing the givensecurityContext.- Parameters:
health- the health to mapsecurityContext- the security contextshowDetails- when to show details in the response- Returns:
- the mapped response