Package tripleplay.syncdb
Class Protocol
java.lang.Object
tripleplay.syncdb.Protocol
Handles the process of syncing a databse with the server.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
AProtocol.Server
implementation that delivers deltas to the server viaNet
.static class
Used to decode ints and strings from one big compact string.static class
Used to encode ints and strings in one big compact string.static class
Encapsulates a sync request from the client.static class
Encapsualtes a response from the server.static interface
Abstracts away the sending of a sync request to the server.static class
Encapsulates a syncing session with the server. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Protocol.Request
decodeRequest
(String payload) Decodes a client request from a compact string format.static Protocol.Response
decodeResponse
(String payload) Decodes a server response from a compact string format.static String
Encodes a client request into a compact string format.static String
Encodes a server response into a compact string format.static int
Returns the current version of the protocol code.
-
Constructor Details
-
Protocol
public Protocol()
-
-
Method Details
-
encodeRequest
Encodes a client request into a compact string format. -
decodeRequest
Decodes a client request from a compact string format. -
encodeResponse
Encodes a server response into a compact string format. -
decodeResponse
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.
-