类 HealthWebEndpointResponseMapper
- java.lang.Object
- org.springframework.boot.actuate.health.HealthWebEndpointResponseMapper
public class HealthWebEndpointResponseMapper extends Object
Maps aHealth
to aWebEndpointResponse
.- 从以下版本开始:
- 2.0.0
构造器概要
构造器 构造器 说明 HealthWebEndpointResponseMapper(HealthStatusHttpMapper statusHttpMapper, ShowDetails showDetails, Set<String> authorizedRoles)
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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
.
构造器详细资料
HealthWebEndpointResponseMapper
public HealthWebEndpointResponseMapper(HealthStatusHttpMapper statusHttpMapper, ShowDetails showDetails, Set<String> authorizedRoles)
方法详细资料
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.- 参数:
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 givenhealth
to aWebEndpointResponse
, honouring the mapper's defaultShowDetails
using 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 givenhealth
to aWebEndpointResponse
, honouring the givenshowDetails
using the givensecurityContext
.- 参数:
health
- the health to mapsecurityContext
- the security contextshowDetails
- when to show details in the response- 返回:
- the mapped response