Interface ProtobufTranslation

  • All Known Implementing Classes:
    ProtobufTranslationImpl

    public interface ProtobufTranslation
    Generic interface to support parsing of serialized protocol buffers between client and server.
    • Method Detail

      • serializeResponse

        byte[] serializeResponse​(Service.Response response)
                          throws java.io.IOException
        Serializes a Service.Response as 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 a Service.Request as 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 a Service.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 a Service.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