Package org.waveprotocol.box.common

Examples of org.waveprotocol.box.common.DeltaSequence


  private WaveletDelta transformSubmittedDelta(WaveletDelta submittedDelta)
      throws OperationException, InvalidHashException {
    HashedVersion targetVersion = submittedDelta.getTargetVersion();
    HashedVersion currentVersion = getCurrentVersion();
    Preconditions.checkArgument(!targetVersion.equals(currentVersion));
    DeltaSequence serverDeltas =
        waveletState.getTransformedDeltaHistory(targetVersion, currentVersion);
    if (serverDeltas == null) {
      LOG.warning("Attempt to apply delta at unknown hashed version " + targetVersion);
      throw new InvalidHashException(currentVersion, targetVersion);
    }
    Preconditions.checkState(!serverDeltas.isEmpty(),
        "No deltas between valid versions %s and %s", targetVersion, currentVersion);

    ParticipantId clientAuthor = submittedDelta.getAuthor();
    // TODO(anorth): remove this copy somehow; currently, it's necessary to
    // ensure that clientOps.equals() works correctly below (because
View Full Code Here


  }

  @Override
  public void waveletUpdate(ReadableWaveletData wavelet, ImmutableList<WaveletDeltaRecord> deltas,
      ImmutableSet<String> domainsToNotify) {
    DeltaSequence sequence = DeltaSequence.of(transformedDeltasOf(deltas));
    for (WaveBus.Subscriber s : subscribers) {
      try {
        s.waveletUpdate(wavelet, sequence);
      } catch (RuntimeException e) {
        LOG.severe("Runtime exception in update to wave bus subscriber " + s, e);
View Full Code Here

        Maps.newTreeMap();
    allTransformedDeltasMap.putAll(cachedDeltas);
    for (WaveletDeltaRecord d : persistedDeltas) {
      allTransformedDeltasMap.put(d.getAppliedAtVersion(), d.getTransformedDelta());
    }
    DeltaSequence nowDeltaSequence;
    if (!allTransformedDeltasMap.isEmpty()
        && allTransformedDeltasMap.firstKey().equals(startVersion)
        && allTransformedDeltasMap.lastEntry().getValue().getResultingVersion().equals(endVersion)) {
      List<TransformedWaveletDelta> cachedAndPersitentDeltasList =
          Lists.newArrayList(allTransformedDeltasMap.values());
View Full Code Here

TOP

Related Classes of org.waveprotocol.box.common.DeltaSequence

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.