public class ProtobufHandler extends AbstractHandler<byte[]>
Service
by converting them to the POJO Request. Returns back the serialized protocol
buffer response.Handler.HandlerResponse<T>
service
HANDLER_SERIALIZATION_METRICS_NAME, HTTP_BAD_REQUEST, HTTP_INTERNAL_SERVER_ERROR, HTTP_OK, HTTP_UNAUTHENTICATED, HTTP_UNAUTHORIZED
Constructor and Description |
---|
ProtobufHandler(Service service,
ProtobufTranslation translation,
MetricsSystem metrics) |
Modifier and Type | Method and Description |
---|---|
Handler.HandlerResponse<byte[]> |
apply(byte[] requestBytes)
Compute a response for the given request, handling errors generated by that computation.
|
badRequestErrorResponse, convertToErrorResponse, setRpcMetadata, unauthenticatedErrorResponse, unauthorizedErrorResponse
public ProtobufHandler(Service service, ProtobufTranslation translation, MetricsSystem metrics)
public Handler.HandlerResponse<byte[]> apply(byte[] requestBytes)
AbstractHandler
apply
in interface Handler<byte[]>
apply
in class AbstractHandler<byte[]>
requestBytes
- The caller's request.Service.Response
with additional context about that response.Copyright © 2012-2024 Apache Software Foundation. All Rights Reserved.