HealthCheckService.@Deprecated public class ManagedHttpHealthCheckService extends HttpHealthCheckService
HttpHealthCheckService which allows overriding its status via a PUT request.
Server server = Server.builder()
.serviceUnder("/health", new ManagedHttpHealthCheckService())
.build();
Default config uses content on or off. You can also use your own path matching.
> Server server =
> Server.builder()
> .serviceUnder("health", new ManagedHttpHealthCheckService() {
> @Override
> public CompletionStage<Optional<Boolean>> mode(HttpRequest req) {
> return CompletableFuture.completedFuture(Optional.empty());
> }
> })
> .build();
| Constructor and Description |
|---|
ManagedHttpHealthCheckService()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
protected HttpResponse |
doPut(ServiceRequestContext ctx,
HttpRequest req)
Deprecated.
Handles a
PUT request. |
protected CompletionStage<Optional<Boolean>> |
mode(ServiceRequestContext ctx,
HttpRequest req)
Deprecated.
Judge the turning mode.
|
doGet, doHead, newHealthyResponse, newUnhealthyResponse, serviceAddeddoDelete, doDelete, doGet, doHead, doOptions, doOptions, doPatch, doPatch, doPost, doPost, doPut, doTrace, doTrace, serveclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitdecorate, decorate, serveas, decorate, shouldCachePathprotected HttpResponse doPut(ServiceRequestContext ctx, HttpRequest req) throws Exception
AbstractHttpServicePUT request.
This method sends a 405 Method Not Allowed response by default.doPut in class AbstractHttpServiceExceptionprotected CompletionStage<Optional<Boolean>> mode(ServiceRequestContext ctx, HttpRequest req)
req - HttpRequestCopyright © 2020 LeanCloud. All rights reserved.