}
private void inner(HttpServletRequest req, HttpServletResponse resp)
throws IOException, JSONException {
JSONObject result = new JSONObject();
SlobStore store = storeSelector.get(session.getStoreType()).getSlobStore();
try {
int revision = Integer.parseInt(requireParameter(req, Params.REVISION));
ConnectResult r = store.reconnect(session.getObjectId(), session.getClientId());
if (r.getChannelToken() != null) {
result.put("token", r.getChannelToken());
HistoryResult history = store.loadHistory(session.getObjectId(), revision, null);
result.put("history", HistoryHandler.serializeHistory(revision, history.getData()));
result.put("head", r.getVersion());
} else {
// TODO(ohler): Figure out and document how the client-server protocol
// works and what the different endpoints do. It's not clear to me why