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());