ServerMutateRequest mutateRequest = new ServerMutateRequestGsonImpl();
mutateRequest.setSession(ObjectSessionHelper.protoFromObjectSession(session));
mutateRequest.setVersion(version);
mutateRequest.addAllPayload(deltas);
MutateResult res;
try {
res = storeSelector.get(session.getStoreType()).getSlobStore().mutateObject(mutateRequest);
} catch (SlobNotFoundException e) {
throw new BadRequestException("Object not found or access denied", e);
} catch (AccessDeniedException e) {
throw new BadRequestException("Object not found or access denied", e);
}
resp.setContentType("application/json");
ServletUtil.writeJsonResult(resp.getWriter(),
ServletUtil.getSubmitDeltaResultJson(res.getResultingVersion()));
}