public class JsonHandler extends AbstractHandler<String>
Handler
that decodes JSON requests, sends them to a Service,
and encodes the responses into JSON.JsonServiceHandler.HandlerResponse<T>| Modifier and Type | Field and Description |
|---|---|
protected static com.fasterxml.jackson.databind.ObjectMapper |
MAPPER |
serviceHANDLER_SERIALIZATION_METRICS_NAME, HTTP_BAD_REQUEST, HTTP_INTERNAL_SERVER_ERROR, HTTP_OK, HTTP_UNAUTHENTICATED, HTTP_UNAUTHORIZED| Constructor and Description |
|---|
JsonHandler(Service service,
MetricsSystem metrics) |
| Modifier and Type | Method and Description |
|---|---|
Handler.HandlerResponse<String> |
apply(String jsonRequest)
Compute a response for the given request, handling errors generated by that computation.
|
badRequestErrorResponse, convertToErrorResponse, setRpcMetadata, unauthenticatedErrorResponse, unauthorizedErrorResponsepublic JsonHandler(Service service, MetricsSystem metrics)
public Handler.HandlerResponse<String> apply(String jsonRequest)
AbstractHandlerapply in interface Handler<String>apply in class AbstractHandler<String>jsonRequest - The caller's request.Service.Response with additional context about that response.Copyright © 2012-2025 Apache Software Foundation. All Rights Reserved.