Package com.google.walkaround.slob.shared

Examples of com.google.walkaround.slob.shared.MessageException


public final class RpcUtil {
  private RpcUtil(){}

  public static JsoView evalPrefixed(String data) throws MessageException {
    if (!data.startsWith(SharedConstants.XSSI_PREFIX)) {
      throw new MessageException("Data did not start with XSSI prefix: " + data);
    }
    return JsUtil.eval(data.substring(SharedConstants.XSSI_PREFIX.length()));
  }
View Full Code Here


    try {
      gsonObj.fromGson(jsonElement, gson, null);
      return gsonObj;
    } catch (RuntimeException e) {
      // I've seen IllegalStateExceptions in JsonArray.getAsString().
      throw new MessageException("Failed to parse " + gsonObj.getClass() + ": " + serialized, e);
    } catch (GsonException e) {
      throw new MessageException("Failed to parse " + gsonObj.getClass() + ": " + serialized, e);
    }
  }
View Full Code Here

      ParticipantId creator, long timestamp) throws MessageException {
    try {
      return OperationFactory.createWaveletOperation(
          new WaveletOperationContext(creator, timestamp, 1), message);
    } catch (InvalidInputException e) {
      throw new MessageException(e);
    }
  }
View Full Code Here

      for (ProtocolWaveletOperation op : batch.getOperation()) {
        operations.add(OperationFactory.createWaveletOperation(context, op));
      }
      return operations;
    } catch (InvalidInputException e) {
      throw new MessageException(e);
    }
  }
View Full Code Here

        }
        docOps.put(docDiff.getDocumentId(), op);
      }
      return docOps;
    } catch (InvalidInputException e) {
      throw new MessageException(e);
    }
  }
View Full Code Here

      addParticipants(wavelet, waveletMessage.getParticipant());
      addDocuments(wavelet, waveletMessage.getDocument());

      return wavelet;
    } catch (InvalidParticipantAddress e) {
      throw new MessageException("Invalid participant address", e);
    } catch (InvalidInputException e) {
      throw new MessageException("Invalid input", e);
    }
  }
View Full Code Here

      addParticipants(wavelet, waveletMessage.getParticipant());
      addDiffDocuments(wavelet, waveletMessage.getDocument());

      return wavelet;
    } catch (InvalidParticipantAddress e) {
      throw new MessageException("Invalid participant address", e);
    } catch (InvalidInputException e) {
      throw new MessageException("Invalid input", e);
    }
  }
View Full Code Here

      return;
    }
    try {
      JsoView jso = JsUtil.eval(data);
      if (!jso.containsKey("id") || !jso.containsKey("m")) {
        throw new MessageException("Missing fields");
      }
      String id = jso.getString("id");
      JsoView m = jso.getJsoView("m");
      GaeChannel channel = channels.get(id);
      if (channel == null) {
View Full Code Here

          public void onSuccess(String data) throws MessageException {
            int requiredClientVersion;
            try {
              requiredClientVersion = Integer.parseInt(data);
            } catch (NumberFormatException nfe) {
              throw new MessageException(nfe);
            }

            if (requiredClientVersion != thisClientVersion) {
              // TODO(danilatos): Automatically refresh (after a random delay),
              // if there's no unsaved data.
View Full Code Here

      data = "(" + data + ")";
    }
    try {
      return evalNative(data);
    } catch (JavaScriptException e) {
      throw new MessageException(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.google.walkaround.slob.shared.MessageException

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.