public class ProtobufTranslationImpl extends Object implements ProtobufTranslation
ProtobufTranslationImpl
that translates
protobuf requests to POJO requests.Constructor and Description |
---|
ProtobufTranslationImpl() |
Modifier and Type | Method and Description |
---|---|
static org.apache.calcite.avatica.remote.ProtobufTranslationImpl.RequestTranslator |
getParserForRequest(String className)
Fetches the concrete message's Parser implementation.
|
static org.apache.calcite.avatica.remote.ProtobufTranslationImpl.ResponseTranslator |
getParserForResponse(String className)
Fetches the concrete message's Parser implementation.
|
Service.Request |
parseRequest(byte[] bytes)
Parses a serialized protocol buffer request into a
Service.Request . |
Service.Response |
parseResponse(byte[] bytes)
Parses a serialized protocol buffer response into a
Service.Response . |
byte[] |
serializeRequest(Service.Request request)
Serializes a
Service.Request as a protocol buffer. |
byte[] |
serializeResponse(Service.Response response)
Serializes a
Service.Response as a protocol buffer. |
public static org.apache.calcite.avatica.remote.ProtobufTranslationImpl.RequestTranslator getParserForRequest(String className)
className
- The protocol buffer class nameIllegalArgumentException
- If the argument is null or if a Parser for the given
class name is not found.public static org.apache.calcite.avatica.remote.ProtobufTranslationImpl.ResponseTranslator getParserForResponse(String className)
className
- The protocol buffer class nameIllegalArgumentException
- If the argument is null or if a Parser for the given
class name is not found.public byte[] serializeResponse(Service.Response response) throws IOException
ProtobufTranslation
Service.Response
as a protocol buffer.serializeResponse
in interface ProtobufTranslation
response
- The response to serializeIOException
- If there are errors during serializationpublic byte[] serializeRequest(Service.Request request) throws IOException
ProtobufTranslation
Service.Request
as a protocol buffer.serializeRequest
in interface ProtobufTranslation
request
- The request to serializeIOException
- If there are errors during serializationpublic Service.Request parseRequest(byte[] bytes) throws IOException
ProtobufTranslation
Service.Request
.parseRequest
in interface ProtobufTranslation
bytes
- Serialized protocol buffer request from clientIOException
- If the protocol buffer cannot be deserializedpublic Service.Response parseResponse(byte[] bytes) throws IOException
ProtobufTranslation
Service.Response
.parseResponse
in interface ProtobufTranslation
bytes
- Serialized protocol buffer request from serverIOException
- If the protocol buffer cannot be deserializedCopyright © 2012–2018 The Apache Software Foundation. All rights reserved.