类 HealthWebEndpointResponseMapper
- java.lang.Object
- org.springframework.boot.actuate.health.HealthWebEndpointResponseMapper
public class HealthWebEndpointResponseMapper extends Object
Maps aHealthto aWebEndpointResponse.- 从以下版本开始:
- 2.0.0
构造器概要
构造器 构造器 说明 HealthWebEndpointResponseMapper(HealthStatusHttpMapper statusHttpMapper, ShowDetails showDetails, Set<String> authorizedRoles)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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.
构造器详细资料
HealthWebEndpointResponseMapper
public HealthWebEndpointResponseMapper(HealthStatusHttpMapper statusHttpMapper, ShowDetails showDetails, Set<String> authorizedRoles)
方法详细资料
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.- 参数:
health- the provider of health details, invoked if the current user has the right to see themsecurityContext- the security context- 返回:
- the mapped response
map
public WebEndpointResponse<Health> map(Health health, SecurityContext securityContext)
Maps the givenhealthto aWebEndpointResponse, honouring the mapper's defaultShowDetailsusing the givensecurityContext.- 参数:
health- the health to mapsecurityContext- the security context- 返回:
- the mapped response
map
public WebEndpointResponse<Health> map(Health health, SecurityContext securityContext, ShowDetails showDetails)
Maps the givenhealthto aWebEndpointResponse, honouring the givenshowDetailsusing the givensecurityContext.- 参数:
health- the health to mapsecurityContext- the security contextshowDetails- when to show details in the response- 返回:
- the mapped response