public class ProtobufHandler extends AbstractHandler<byte[]>
Service
by converting them to the POJO Request. Returns back the serialized protocol
buffer response.Handler.HandlerResponse<T>| Modifier and Type | Field and Description |
|---|---|
private ProtobufTranslation |
translation |
serviceHTTP_INTERNAL_SERVER_ERROR, HTTP_OK| Constructor and Description |
|---|
ProtobufHandler(Service service,
ProtobufTranslation translation) |
| 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.
|
(package private) Service.Request |
decode(byte[] serializedRequest) |
(package private) byte[] |
encode(Service.Response response)
Serialize the given
Service.Response per the concrete Handler implementation. |
setRpcMetadata, unwrapExceptionprivate final ProtobufTranslation translation
public ProtobufHandler(Service service, ProtobufTranslation translation)
public Handler.HandlerResponse<byte[]> apply(byte[] requestBytes)
AbstractHandlerapply in interface Handler<byte[]>apply in class AbstractHandler<byte[]>requestBytes - The caller's request.Service.Response with additional context about that response.Service.Request decode(byte[] serializedRequest) throws IOException
decode in class AbstractHandler<byte[]>IOExceptionbyte[] encode(Service.Response response) throws IOException
AbstractHandlerService.Response per the concrete Handler implementation.encode in class AbstractHandler<byte[]>response - The Service.Response to serialize.Service.Response.IOExceptionCopyright © 2012–2016 The Apache Software Foundation. All rights reserved.