-
Notifications
You must be signed in to change notification settings - Fork 91
Client Server Communication
Who says what to whom, and how.
There are two types of communication with the server piece:
- GWT-RPC of DTOs between the browser and the server.
- HTTP GET and POST for experiments and events used by all other clients, including the Android client.
The data model on the server is pretty simple.
We have the notion of an Experiment and an Event. Experiments have Inputs. When a user answers an Input according to a SignalSchedule, the outputs for a given signal are collected in an Event.
We can also show the user Feedback, which may be customized html, javascript, and css, that is predicated on the data in the Events. There is a default feedback shown to the user already on the phone app.
Some things require special storage, like PhotoBlob for Inputs that collect picture data. And hopefully in the future sound and video.
These 6 datatypes are sent back in forth to the Browser GWT client as DTOs, so there are DTO objects for each of these six that are pretty brain dead. There is also code that converts between them -- this needs to be refactored into Protobuf or something that gwt can use.
The main GWT-RPC endpoint is MapServiceImpl (yes, we need to change that name now that the prototype has grown up a little).
Outside of the GWT-RPC servlets, there are some basic servlets to deal with the Android client's needs and hopefully to facilitate server to server mashups in the future.
EventServlet handles getting and posting of events. Gets at the http://host/events endpoint according to the query language in a SmallPacoEventQueryLanguage.
ExperimentServlet handles get calls for experiment definitions. It should also allow posting of experiment definitions at some point. It handles these calls at http://host/experiments.