Package com.google.walkaround.proto

Examples of com.google.walkaround.proto.ServerMutateResponse


    if (result.isRejected()) {
      throw new BadRequestException(result.exception);
    }

    ServerMutateResponse response = new ServerMutateResponseGsonImpl();
    response.setResultingVersion(result.getResultingRevision());
    response.setBroadcastData(jsonBroadcastData(objectId, result.getBroadcastData()));
    return response;
  }
View Full Code Here


    Preconditions.checkArgument(req.getVersion() != 0,
        // NOTE(ohler): In Google Wave, there were security concerns around
        // creating objects by submitting deltas against version 0.  I'm not
        // sure Walkaround has the same problems, but let's disallow it anyway.
        "Can't create objects with mutateObject()");
    ServerMutateResponse response = defaultProcessor.mutateObject(req);
    MutateResult result = new MutateResult(response.getResultingVersion());
    if (response.getBroadcastData() != null) {
      messageRouter.publishMessages(objectId, response.getBroadcastData());
    }
    return result;
  }
View Full Code Here

          requestString);
    } catch (MessageException e) {
      throw new BadRequestException("Failed to parse request: " + requestString, e);
    }
    ObjectSession session = ObjectSessionHelper.objectSessionFromProto(mutateRequest.getSession());
    ServerMutateResponse result =
        storeSelector.get(session.getStoreType()).getLocalMutationProcessor()
        .mutateObject(mutateRequest);
    log.info("Success @" + result.getResultingVersion());

    resp.setStatus(200);
    resp.setContentType("application/json");
    resp.setCharacterEncoding("UTF-8");
    resp.getWriter().print("OK" + GsonProto.toJson((GsonSerializable) result));
View Full Code Here

  }

  public ServerMutateResponse mutateObject(ServerMutateRequest req) throws IOException {
    // TODO(danilatos): Document strategy.

    ServerMutateResponse result;
    SlobId objectId = new SlobId(req.getSession().getObjectId());

    if (numStoreServers == 0) {
      monitoring.incrementCounter("affinity-backends-disabled");
      result = localProcessor.mutateObject(req);
View Full Code Here

TOP

Related Classes of com.google.walkaround.proto.ServerMutateResponse

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.