public final class HealthCheckServiceBuilder extends Object
HealthCheckService.| Modifier and Type | Method and Description |
|---|---|
HealthCheckService |
build()
Returns a newly created
HealthCheckService built from the properties specified so far. |
HealthCheckServiceBuilder |
checkers(HealthChecker... healthCheckers)
Adds the specified
HealthCheckers that determine the healthiness of the Server. |
HealthCheckServiceBuilder |
checkers(Iterable<? extends HealthChecker> healthCheckers)
Adds the specified
HealthCheckers that determine the healthiness of the Server. |
HealthCheckServiceBuilder |
healthyResponse(AggregatedHttpResponse healthyResponse)
Sets the
AggregatedHttpResponse to send when the Service is healthy. |
HealthCheckServiceBuilder |
longPolling(Duration maxLongPollingTimeout)
Enables or disables long-polling support.
|
HealthCheckServiceBuilder |
longPolling(Duration maxLongPollingTimeout,
double longPollingTimeoutJitterRate)
Deprecated.
|
HealthCheckServiceBuilder |
longPolling(Duration maxLongPollingTimeout,
double longPollingTimeoutJitterRate,
Duration pingInterval)
Enables or disables long-polling support.
|
HealthCheckServiceBuilder |
longPolling(long maxLongPollingTimeoutMillis)
Enables or disables long-polling support.
|
HealthCheckServiceBuilder |
longPolling(long maxLongPollingTimeoutMillis,
double longPollingTimeoutJitterRate)
Deprecated.
|
HealthCheckServiceBuilder |
longPolling(long maxLongPollingTimeoutMillis,
double longPollingTimeoutJitterRate,
long pingIntervalMillis)
Enables or disables long-polling support.
|
HealthCheckServiceBuilder |
unhealthyResponse(AggregatedHttpResponse unhealthyResponse)
Sets the
AggregatedHttpResponse to send when the Service is unhealthy. |
HealthCheckServiceBuilder |
updatable(boolean updatable)
Specifies whether the healthiness of the
Server can be updated by sending a PUT,
POST or PATCH request to the HealthCheckService. |
HealthCheckServiceBuilder |
updatable(HealthCheckUpdateHandler updateHandler)
Specifies a
HealthCheckUpdateHandler which handles other HTTP methods than HEAD and
GET which updates the healthiness of the Server. |
public HealthCheckServiceBuilder checkers(HealthChecker... healthCheckers)
HealthCheckers that determine the healthiness of the Server.thispublic HealthCheckServiceBuilder checkers(Iterable<? extends HealthChecker> healthCheckers)
HealthCheckers that determine the healthiness of the Server.thispublic HealthCheckServiceBuilder healthyResponse(AggregatedHttpResponse healthyResponse)
AggregatedHttpResponse to send when the Service is healthy. The following
response is sent by default:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
{ "healthy": true }
thispublic HealthCheckServiceBuilder unhealthyResponse(AggregatedHttpResponse unhealthyResponse)
AggregatedHttpResponse to send when the Service is unhealthy. The following
response is sent by default:
HTTP/1.1 503 Service Unavailable
Content-Type: application/json; charset=utf-8
{ "healthy": false }
thispublic HealthCheckServiceBuilder longPolling(Duration maxLongPollingTimeout)
maxLongPollingTimeout - A positive maximum allowed timeout value which is specified by a client
in the "prefer: wait=<n>" request header.
Specify 0 to disable long-polling support.thislongPolling(Duration, double, Duration)public HealthCheckServiceBuilder longPolling(long maxLongPollingTimeoutMillis)
maxLongPollingTimeoutMillis - A positive maximum allowed timeout value which is specified by
a client in the "prefer: wait=<n>" request header.
Specify 0 to disable long-polling support.thislongPolling(long, double, long)@Deprecated public HealthCheckServiceBuilder longPolling(Duration maxLongPollingTimeout, double longPollingTimeoutJitterRate)
longPolling(Duration, double, Duration).maxLongPollingTimeout - A positive maximum allowed timeout value which is specified by a client
in the "prefer: wait=<n>" request header.
Specify 0 to disable long-polling support.longPollingTimeoutJitterRate - The jitter rate which adds a random variation to the long-polling
timeout specified in the "prefer: wait=<n>" header.thislongPolling(Duration)@Deprecated public HealthCheckServiceBuilder longPolling(long maxLongPollingTimeoutMillis, double longPollingTimeoutJitterRate)
longPolling(long, double, long).maxLongPollingTimeoutMillis - A positive maximum allowed timeout value which is specified by
a client in the "prefer: wait=<n>" request header.
Specify 0 to disable long-polling support.longPollingTimeoutJitterRate - The jitter rate which adds a random variation to the long-polling
timeout specified in the "prefer: wait=<n>" header.thislongPolling(long)public HealthCheckServiceBuilder longPolling(Duration maxLongPollingTimeout, double longPollingTimeoutJitterRate, Duration pingInterval)
maxLongPollingTimeout - A positive maximum allowed timeout value which is specified by a client
in the "prefer: wait=<n>" request header.
Specify 0 to disable long-polling support.longPollingTimeoutJitterRate - The jitter rate which adds a random variation to the long-polling
timeout specified in the "prefer: wait=<n>" header.thislongPolling(Duration)public HealthCheckServiceBuilder longPolling(long maxLongPollingTimeoutMillis, double longPollingTimeoutJitterRate, long pingIntervalMillis)
maxLongPollingTimeoutMillis - A positive maximum allowed timeout value which is specified by
a client in the "prefer: wait=<n>" request header.
Specify 0 to disable long-polling support.longPollingTimeoutJitterRate - The jitter rate which adds a random variation to the long-polling
timeout specified in the "prefer: wait=<n>" header.thislongPolling(long)public HealthCheckServiceBuilder updatable(boolean updatable)
Server can be updated by sending a PUT,
POST or PATCH request to the HealthCheckService. This feature is disabled
by default. If enabled, a JSON object which has a boolean property named "healthy" can be
sent using a PUT or POST request. A JSON patch in a PATCH request is also
accepted. It is recommended to employ some authorization mechanism such as AuthService
when enabling this feature.thisupdatable(HealthCheckUpdateHandler)public HealthCheckServiceBuilder updatable(HealthCheckUpdateHandler updateHandler)
HealthCheckUpdateHandler which handles other HTTP methods than HEAD and
GET which updates the healthiness of the Server. This feature is disabled by default.
It is recommended to employ some authorization mechanism such as AuthService
when enabling this feature.updateHandler - The HealthCheckUpdateHandler which handles PUT, POST or
PATCH requests and tells if the Server needs to be marked as
healthy or unhealthy.updatable(boolean)public HealthCheckService build()
HealthCheckService built from the properties specified so far.Copyright © 2020 LeanCloud. All rights reserved.