Committing finally the server side code that I have been testing with. It basically takes HTTP request on a specific port and supports the two different protocols created so far. It reuses the code used for the app to avoid duplication.
Changed the contract on the merge function of the counter so it returns a new object as a result of a merge and doesn't modify the initial objects.
Nodifying the crdt factory file. Added a method to create CRDT objects, by providing ID, data in json format and the name of the crdt. This allows the server side to be able of handle CRDTs indifferently without checking which kind of object is it.
Created a method to build the payload of the response inthe DirectReplication protocol so it can be used by the server side so I do not repeat the code.
Nodifying a lot of components that are needed on the server side. Now this components work for the chrome application and the server side code.
Creating a file to hold the constants regarding server ip and port.
Renewing replica identity on application startup, and changing the direct replication process.
The onClose event for the window is better handled here because in the interactionLogic the message passing API does not work since the window is closing.
Interaction logic does not add a callback on the onClose event of the window. Better handled in the background.
Adding permissions to the app to be able of sending requests to the server.
The timestamp of replica identity can be updated at any time. This is useful to track application lifecycle. On start up we create the identity.
Several functions to replicate counters and registers to the server, and to perform direct replication from the server. If the server is not available, then direct replication will be performed from a peer.
Adding support to ServerConstants.
Formatting.