Interface ProtobufTranslation
-
- All Known Implementing Classes:
ProtobufTranslationImpl
public interface ProtobufTranslationGeneric interface to support parsing of serialized protocol buffers between client and server.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Service.RequestparseRequest(byte[] bytes)Parses a serialized protocol buffer request into aService.Request.Service.ResponseparseResponse(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 Detail
-
serializeResponse
byte[] serializeResponse(Service.Response response) throws java.io.IOException
Serializes aService.Responseas a protocol buffer.- Parameters:
response- The response to serialize- Throws:
java.io.IOException- If there are errors during serialization
-
serializeRequest
byte[] serializeRequest(Service.Request request) throws java.io.IOException
Serializes aService.Requestas a protocol buffer.- Parameters:
request- The request to serialize- Throws:
java.io.IOException- If there are errors during serialization
-
parseRequest
Service.Request parseRequest(byte[] bytes) throws java.io.IOException
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:
java.io.IOException- If the protocol buffer cannot be deserialized
-
parseResponse
Service.Response parseResponse(byte[] bytes) throws java.io.IOException
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:
java.io.IOException- If the protocol buffer cannot be deserialized
-
-