@ExperimentalApi public final class HealthStatusManager extends Object
HealthStatusManager object manages a health check service. A health check service is
created in the constructor of HealthStatusManager, and it can be retrieved by the
getHealthService() method.
The health status manager can update the health statuses of the server.| Constructor and Description |
|---|
HealthStatusManager()
Creates a new health service instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearStatus(String service)
Clears the health status record of a service.
|
io.grpc.health.v1.HealthGrpc.HealthImplBase |
getHealthService()
Gets the health check service created in the constructor.
|
void |
setStatus(String service,
io.grpc.health.v1.HealthCheckResponse.ServingStatus status)
Updates the status of the server.
|
public HealthStatusManager()
public io.grpc.health.v1.HealthGrpc.HealthImplBase getHealthService()
public void setStatus(String service, io.grpc.health.v1.HealthCheckResponse.ServingStatus status)
service - the name of some aspect of the server that is associated with a health status.
This name can have no relation with the gRPC services that the server is running with.
It can also be an empty String "" per the gRPC specification.status - is one of the values HealthCheckResponse.ServingStatus.SERVING,
HealthCheckResponse.ServingStatus.NOT_SERVING and HealthCheckResponse.ServingStatus.UNKNOWN.public void clearStatus(String service)
service - the name of some aspect of the server that is associated with a health status.
This name can have no relation with the gRPC services that the server is running with.
It can also be an empty String "" per the gRPC specification.