Package com.google.walkaround.proto

Examples of com.google.walkaround.proto.OperationBatch


  /**
   * Serializes OperationBatch to JSON string.
   */
  public String serializeOperationBatch(List<WaveletOperation> input) {
    Preconditions.checkState(input.size() >= 1, "Operation batch input should have >= 1 items");
    OperationBatch batch = MessageFactoryHelper.createOperationBatch();
    for (WaveletOperation op : input) {
      batch.addOperation(OperationSerializer.createMessage(op));
    }
    return serializer.serializeOperationBatch(batch);
  }
View Full Code Here


  }

  public List<WaveletOperation> deserializeOperationBatch(
      ParticipantId author, String serializedOperationBatch,
      long timestamp) throws MessageException {
    OperationBatch batch = serializer.deserializeOperationBatch(serializedOperationBatch);
    List<WaveletOperation> operations = new ArrayList<WaveletOperation>();
    try {
      WaveletOperationContext context =
          new WaveletOperationContext(author, timestamp, VERSION_INC);
      for (ProtocolWaveletOperation op : batch.getOperation()) {
        operations.add(OperationFactory.createWaveletOperation(context, op));
      }
      return operations;
    } catch (InvalidInputException e) {
      throw new MessageException(e);
View Full Code Here

TOP

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

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.