| Modifier and Type | Method and Description |
|---|---|
ServiceRequestContext |
DefaultClientRequestContext.root() |
ServiceRequestContext |
ClientRequestContextWrapper.root() |
ServiceRequestContext |
ClientRequestContext.root()
Returns the
ServiceRequestContext whose Service invokes the Client
Request which created this ClientRequestContext, or null if this client request
was not made in the context of a server request. |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
AnnotatedService.serve(ServiceRequestContext ctx,
HttpRequest req) |
| Modifier and Type | Class and Description |
|---|---|
class |
DefaultServiceRequestContext
Default
ServiceRequestContext implementation. |
class |
ServiceRequestContextWrapper
Wraps an existing
ServiceRequestContext. |
| Modifier and Type | Method and Description |
|---|---|
ServiceRequestContext |
ServiceRequestContextBuilder.build()
Returns a new
ServiceRequestContext created with the properties of this builder. |
static ServiceRequestContext |
ServiceRequestContext.current()
Returns the server-side context of the
Request that is being handled in the current thread. |
static ServiceRequestContext |
ServiceRequestContext.currentOrNull()
Returns the server-side context of the
Request that is being handled in the current thread. |
ServiceRequestContext |
ServiceRequestContextWrapper.newDerivedContext(RequestId id,
HttpRequest req,
RpcRequest rpcReq) |
ServiceRequestContext |
ServiceRequestContext.newDerivedContext(RequestId id,
HttpRequest req,
RpcRequest rpcReq) |
ServiceRequestContext |
DefaultServiceRequestContext.newDerivedContext(RequestId id,
HttpRequest req,
RpcRequest rpcReq) |
static ServiceRequestContext |
ServiceRequestContext.of(HttpRequest request)
Returns a new
ServiceRequestContext created from the specified HttpRequest. |
| Modifier and Type | Method and Description |
|---|---|
protected HttpResponse |
AbstractHttpService.doDelete(ServiceRequestContext ctx,
HttpRequest req)
Handles a
DELETE request. |
protected void |
AbstractHttpService.doDelete(ServiceRequestContext ctx,
HttpRequest req,
HttpResponseWriter res)
Deprecated.
|
protected HttpResponse |
AbstractHttpService.doGet(ServiceRequestContext ctx,
HttpRequest req)
Handles a
GET request. |
protected void |
AbstractHttpService.doGet(ServiceRequestContext ctx,
HttpRequest req,
HttpResponseWriter res)
Deprecated.
|
protected HttpResponse |
AbstractHttpService.doHead(ServiceRequestContext ctx,
HttpRequest req)
Handles a
HEAD request. |
protected void |
AbstractHttpService.doHead(ServiceRequestContext ctx,
HttpRequest req,
HttpResponseWriter res)
Deprecated.
|
protected HttpResponse |
AbstractHttpService.doOptions(ServiceRequestContext ctx,
HttpRequest req)
Handles an
OPTIONS request. |
protected void |
AbstractHttpService.doOptions(ServiceRequestContext ctx,
HttpRequest req,
HttpResponseWriter res)
Deprecated.
|
protected HttpResponse |
AbstractHttpService.doPatch(ServiceRequestContext ctx,
HttpRequest req)
Handles a
PATCH request. |
protected void |
AbstractHttpService.doPatch(ServiceRequestContext ctx,
HttpRequest req,
HttpResponseWriter res)
Deprecated.
|
protected HttpResponse |
AbstractHttpService.doPost(ServiceRequestContext ctx,
HttpRequest req)
Handles a
POST request. |
protected void |
AbstractHttpService.doPost(ServiceRequestContext ctx,
HttpRequest req,
HttpResponseWriter res)
Deprecated.
|
protected HttpResponse |
AbstractHttpService.doPut(ServiceRequestContext ctx,
HttpRequest req)
Handles a
PUT request. |
protected void |
AbstractHttpService.doPut(ServiceRequestContext ctx,
HttpRequest req,
HttpResponseWriter res)
Deprecated.
|
protected HttpResponse |
AbstractHttpService.doTrace(ServiceRequestContext ctx,
HttpRequest req)
Handles a
TRACE request. |
protected void |
AbstractHttpService.doTrace(ServiceRequestContext ctx,
HttpRequest req,
HttpResponseWriter res)
Deprecated.
|
HttpResponse |
DecoratingHttpServiceFunction.serve(HttpService delegate,
ServiceRequestContext ctx,
HttpRequest req)
Serves an incoming
HttpRequest. |
RpcResponse |
DecoratingRpcServiceFunction.serve(RpcService delegate,
ServiceRequestContext ctx,
RpcRequest req)
Serves an incoming
RpcRequest. |
HttpResponse |
RedirectService.serve(ServiceRequestContext ctx,
HttpRequest req)
NB: For now we redirect all methods.
|
HttpResponse |
HttpService.serve(ServiceRequestContext ctx,
HttpRequest req) |
HttpResponse |
AbstractHttpService.serve(ServiceRequestContext ctx,
HttpRequest req)
Serves the specified
HttpRequest by delegating it to the matching 'doMETHOD()' method. |
O |
Service.serve(ServiceRequestContext ctx,
I req)
Serves an incoming
Request. |
RpcResponse |
RpcService.serve(ServiceRequestContext ctx,
RpcRequest req) |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
ServiceRequestContext.mapCurrent(Function<? super ServiceRequestContext,T> mapper,
Supplier<T> defaultValueSupplier)
Maps the server-side context of the
Request that is being handled in the current thread. |
| Constructor and Description |
|---|
ServiceRequestContextWrapper(ServiceRequestContext delegate)
Creates a new instance.
|
| Constructor and Description |
|---|
RedirectService(Function<? super ServiceRequestContext,String> locationFunction)
Creates a new instance that redirects to the location returned by
locationFunction,
preserving the query string in the request URI. |
RedirectService(Function<? super ServiceRequestContext,String> locationFunction,
boolean preserveQueryString)
Creates a new instance that redirects to the location returned by
locationFunction. |
RedirectService(HttpStatus redirectStatus,
Function<? super ServiceRequestContext,String> locationFunction)
Creates a new instance that redirects to the location returned by
locationFunction,
preserving the query string in the request URI. |
RedirectService(HttpStatus redirectStatus,
Function<? super ServiceRequestContext,String> locationFunction,
boolean preserveQueryString)
Creates a new instance that redirects to the location returned by
locationFunction. |
| Modifier and Type | Method and Description |
|---|---|
Object |
StringRequestConverterFunction.convertRequest(ServiceRequestContext ctx,
AggregatedHttpRequest request,
Class<?> expectedResultType)
Converts the specified
AggregatedHttpRequest to a String. |
Object |
RequestConverterFunction.convertRequest(ServiceRequestContext ctx,
AggregatedHttpRequest request,
Class<?> expectedResultType)
Converts the specified
request to an object of expectedResultType. |
Object |
JacksonRequestConverterFunction.convertRequest(ServiceRequestContext ctx,
AggregatedHttpRequest request,
Class<?> expectedResultType)
Converts the specified
AggregatedHttpRequest to an object of expectedResultType. |
Object |
ByteArrayRequestConverterFunction.convertRequest(ServiceRequestContext ctx,
AggregatedHttpRequest request,
Class<?> expectedResultType)
Converts the specified
AggregatedHttpRequest to an object of expectedResultType. |
HttpResponse |
StringResponseConverterFunction.convertResponse(ServiceRequestContext ctx,
ResponseHeaders headers,
Object result,
HttpHeaders trailers) |
HttpResponse |
ServerSentEventResponseConverterFunction.convertResponse(ServiceRequestContext ctx,
ResponseHeaders headers,
Object result,
HttpHeaders trailers) |
HttpResponse |
ResponseConverterFunction.convertResponse(ServiceRequestContext ctx,
ResponseHeaders headers,
Object result,
HttpHeaders trailers)
Returns
HttpResponse instance corresponds to the given result. |
HttpResponse |
NullToNoContentResponseConverterFunction.convertResponse(ServiceRequestContext ctx,
ResponseHeaders headers,
Object result,
HttpHeaders trailers) |
HttpResponse |
JacksonResponseConverterFunction.convertResponse(ServiceRequestContext ctx,
ResponseHeaders headers,
Object result,
HttpHeaders trailers) |
HttpResponse |
ByteArrayResponseConverterFunction.convertResponse(ServiceRequestContext ctx,
ResponseHeaders headers,
Object result,
HttpHeaders trailers) |
HttpResponse |
ExceptionHandlerFunction.handleException(ServiceRequestContext ctx,
HttpRequest req,
Throwable cause)
Returns an
HttpResponse which would be sent back to the client who sent the req. |
| Modifier and Type | Method and Description |
|---|---|
O |
AuthFailureHandler.authFailed(Service<I,O> delegate,
ServiceRequestContext ctx,
I req,
Throwable cause)
Invoked when the authorization of the specified
Request has failed. |
CompletionStage<Boolean> |
Authorizer.authorize(ServiceRequestContext ctx,
T data)
Authorizes the given
data. |
O |
AuthSuccessHandler.authSucceeded(Service<I,O> delegate,
ServiceRequestContext ctx,
I req)
Invoked when the authorization of the specified
Request has succeeded. |
HttpResponse |
AuthService.serve(ServiceRequestContext ctx,
HttpRequest req) |
| Modifier and Type | Method and Description |
|---|---|
O |
AbstractCompositeService.serve(ServiceRequestContext ctx,
I req) |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
CorsService.serve(ServiceRequestContext ctx,
HttpRequest req) |
| Modifier and Type | Method and Description |
|---|---|
DocServiceBuilder |
DocServiceBuilder.injectedScriptSupplier(BiFunction<ServiceRequestContext,HttpRequest,String> supplier)
Adds a supplier for Javascript scripts to inject into the
<head /> of the debug page HTML. |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
EncodingService.serve(ServiceRequestContext ctx,
HttpRequest req) |
| Modifier and Type | Method and Description |
|---|---|
protected HttpResponse |
FileService.doGet(ServiceRequestContext ctx,
HttpRequest req) |
| Modifier and Type | Method and Description |
|---|---|
protected HttpResponse |
HttpHealthCheckService.doGet(ServiceRequestContext ctx,
HttpRequest req)
Deprecated.
|
protected HttpResponse |
HttpHealthCheckService.doHead(ServiceRequestContext ctx,
HttpRequest req)
Deprecated.
|
protected HttpResponse |
ManagedHttpHealthCheckService.doPut(ServiceRequestContext ctx,
HttpRequest req)
Deprecated.
|
CompletionStage<HealthCheckUpdateResult> |
HealthCheckUpdateHandler.handle(ServiceRequestContext ctx,
HttpRequest req)
Determines if the healthiness of the
Server needs to be changed or not from the given
HttpRequest. |
protected CompletionStage<Optional<Boolean>> |
ManagedHttpHealthCheckService.mode(ServiceRequestContext ctx,
HttpRequest req)
Deprecated.
Judge the turning mode.
|
protected AggregatedHttpResponse |
HttpHealthCheckService.newHealthyResponse(ServiceRequestContext ctx)
Deprecated.
Creates a new response which is sent when the
Server is healthy. |
protected AggregatedHttpResponse |
HttpHealthCheckService.newUnhealthyResponse(ServiceRequestContext ctx)
Deprecated.
Creates a new response which is sent when the
Server is unhealthy. |
HttpResponse |
HealthCheckService.serve(ServiceRequestContext ctx,
HttpRequest req) |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
LoggingService.serve(ServiceRequestContext ctx,
HttpRequest req) |
HttpResponse |
ContentPreviewingService.serve(ServiceRequestContext ctx,
HttpRequest req) |
| Modifier and Type | Method and Description |
|---|---|
LoggingServiceBuilder |
LoggingServiceBuilder.sampler(Sampler<? super ServiceRequestContext> sampler)
Sets the
Sampler that determines which request needs logging. |
| Modifier and Type | Method and Description |
|---|---|
protected HttpResponse |
PrometheusExpositionService.doGet(ServiceRequestContext ctx,
HttpRequest req) |
protected HttpResponse |
PrometheusExpositionService.doPost(ServiceRequestContext ctx,
HttpRequest req) |
HttpResponse |
MetricCollectingService.serve(ServiceRequestContext ctx,
HttpRequest req) |
| Modifier and Type | Method and Description |
|---|---|
abstract CompletionStage<Boolean> |
ThrottlingStrategy.accept(ServiceRequestContext ctx,
T request)
Returns whether a given request should be treated as failed before it is handled actually.
|
CompletionStage<Boolean> |
RateLimitingThrottlingStrategy.accept(ServiceRequestContext ctx,
T request) |
protected HttpResponse |
ThrottlingService.onFailure(ServiceRequestContext ctx,
HttpRequest req,
Throwable cause)
Invoked when
req is throttled. |
protected abstract O |
AbstractThrottlingService.onFailure(ServiceRequestContext ctx,
I req,
Throwable cause)
Invoked when
req is throttled. |
protected RpcResponse |
ThrottlingRpcService.onFailure(ServiceRequestContext ctx,
RpcRequest req,
Throwable cause)
Invoked when
req is throttled. |
protected O |
AbstractThrottlingService.onSuccess(ServiceRequestContext ctx,
I req)
Invoked when
req is not throttled. |
O |
AbstractThrottlingService.serve(ServiceRequestContext ctx,
I req) |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Request> |
ThrottlingStrategy.of(BiFunction<ServiceRequestContext,T,CompletionStage<Boolean>> function)
Creates a new
ThrottlingStrategy that determines whether a request should be accepted or not
using a given BiFunction instance. |
static <T extends Request> |
ThrottlingStrategy.of(BiFunction<ServiceRequestContext,T,CompletionStage<Boolean>> function,
String strategyName)
Creates a new
ThrottlingStrategy that determines whether a request should be accepted or not
using a given BiFunction instance. |
Copyright © 2020 LeanCloud. All rights reserved.