public class HealthWebEndpointResponseMapper extends Object
Health
to a WebEndpointResponse
.Constructor and Description |
---|
HealthWebEndpointResponseMapper(HealthStatusHttpMapper statusHttpMapper,
ShowDetails showDetails,
Set<String> authorizedRoles) |
Modifier and Type | Method and Description |
---|---|
WebEndpointResponse<Health> |
map(Health health,
SecurityContext securityContext)
Maps the given
health to a WebEndpointResponse , honouring the
mapper's default ShowDetails using the given securityContext . |
WebEndpointResponse<Health> |
map(Health health,
SecurityContext securityContext,
ShowDetails showDetails)
Maps the given
health to a WebEndpointResponse , honouring the given
showDetails using the given securityContext . |
WebEndpointResponse<Health> |
mapDetails(Supplier<Health> health,
SecurityContext securityContext)
Maps the given
health details to a WebEndpointResponse , honouring
the mapper's default ShowDetails using the given securityContext . |
public HealthWebEndpointResponseMapper(HealthStatusHttpMapper statusHttpMapper, ShowDetails showDetails, Set<String> authorizedRoles)
public WebEndpointResponse<Health> mapDetails(Supplier<Health> health, SecurityContext securityContext)
health
details to a WebEndpointResponse
, honouring
the mapper's default ShowDetails
using the given securityContext
.
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 contextpublic WebEndpointResponse<Health> map(Health health, SecurityContext securityContext)
health
to a WebEndpointResponse
, honouring the
mapper's default ShowDetails
using the given securityContext
.health
- the health to mapsecurityContext
- the security contextpublic WebEndpointResponse<Health> map(Health health, SecurityContext securityContext, ShowDetails showDetails)
health
to a WebEndpointResponse
, honouring the given
showDetails
using the given securityContext
.health
- the health to mapsecurityContext
- the security contextshowDetails
- when to show details in the responseCopyright © 2018 Pivotal Software, Inc.. All rights reserved.