Class Protocol

java.lang.Object
tripleplay.syncdb.Protocol

public class Protocol extends Object
Handles the process of syncing a databse with the server.
  • Constructor Details

    • Protocol

      public Protocol()
  • Method Details

    • encodeRequest

      public static String encodeRequest(Protocol.Request req)
      Encodes a client request into a compact string format.
    • decodeRequest

      public static Protocol.Request decodeRequest(String payload)
      Decodes a client request from a compact string format.
    • encodeResponse

      public static String encodeResponse(Protocol.Response rsp)
      Encodes a server response into a compact string format.
    • decodeResponse

      public static Protocol.Response decodeResponse(String payload)
      Decodes a server response from a compact string format.
    • protocolVersion

      public static int protocolVersion()
      Returns the current version of the protocol code. This is used to handle backwards compatibility in the unlikely event that this very simple protocol evolves. We can't rely on clients to update themselves, so we may need to bridge the gap on the server.