Interface ProtobufTranslation
- All Known Implementing Classes:
ProtobufTranslationImpl
public interface ProtobufTranslation
Generic interface to support parsing of serialized protocol buffers between client and server.
-
Method Summary
Modifier and TypeMethodDescriptionparseRequest(byte[] bytes) Parses a serialized protocol buffer request into aService.Request.parseResponse(byte[] bytes) Parses a serialized protocol buffer response into aService.Response.byte[]serializeRequest(Service.Request request) Serializes aService.Requestas a protocol buffer.byte[]serializeResponse(Service.Response response) Serializes aService.Responseas a protocol buffer.
-
Method Details
-
serializeResponse
Serializes aService.Responseas a protocol buffer.- Parameters:
response- The response to serialize- Throws:
IOException- If there are errors during serialization
-
serializeRequest
Serializes aService.Requestas a protocol buffer.- Parameters:
request- The request to serialize- Throws:
IOException- If there are errors during serialization
-
parseRequest
Parses a serialized protocol buffer request into aService.Request.- Parameters:
bytes- Serialized protocol buffer request from client- Returns:
- A Request object for the given bytes
- Throws:
IOException- If the protocol buffer cannot be deserialized
-
parseResponse
Parses a serialized protocol buffer response into aService.Response.- Parameters:
bytes- Serialized protocol buffer request from server- Returns:
- The Response object for the given bytes
- Throws:
IOException- If the protocol buffer cannot be deserialized
-