Package org.waveprotocol.wave.model.wave.data.impl

Examples of org.waveprotocol.wave.model.wave.data.impl.WaveletDataImpl


  private final WaveViewData waveViewData;

  public TestingWaveletData(
      WaveId waveId, WaveletId waveletId, ParticipantId author, boolean isConversational) {
    waveletData =
        new WaveletDataImpl(waveletId, author, 1234567890, 0, HashedVersion.unsigned(0), 0,
            waveId, BasicFactories.observablePluggableMutableDocumentFactory());
    userWaveletData =
        new WaveletDataImpl(WaveletId.of("example.com", "user+foo@example.com"), author,
            1234567890, 0, HashedVersion.unsigned(0), 0,
          waveId, BasicFactories.observablePluggableMutableDocumentFactory());
   
    OpBasedWavelet wavelet =
      new OpBasedWavelet(waveId, waveletData, new BasicWaveletOperationContextFactory(author),
View Full Code Here


  @Override
  public void setUp() {
    WaveId waveId = WaveId.of("example.com", "c+123");
    WaveletId waveletId = WaveletId.of("example.com", IdConstants.CONVERSATION_ROOT_WAVELET);
    wavelet = new WaveletDataImpl(waveletId, CREATOR, 0L, 0L,
        HashedVersion.unsigned(0), 0L, waveId,
        BasicFactories.pluggableMutableDocumentFactory());
  }
View Full Code Here

      final WaveletOperationalizer operationalizer = getWavelets();
      WaveletFactory<OpBasedWavelet> waveletFactory = new WaveletFactory<OpBasedWavelet>() {
        @Override
        public OpBasedWavelet create(WaveId waveId, WaveletId id, ParticipantId creator) {
          long now = System.currentTimeMillis();
          ObservableWaveletData data = new WaveletDataImpl(id,
              creator,
              now,
              0L,
              HashedVersion.unsigned(0),
              now,
View Full Code Here

      // Now build one that has the same setup state as that required by
      // undercurrent (complex issue with the per-document output sinks).
      WaveViewDataImpl newData = WaveViewDataImpl.create(sampleData.getWaveId());
      WaveletDataImpl.Factory copier = WaveletDataImpl.Factory.create(docFactory);
      for (ReadableWaveletData src : sampleData.getWavelets()) {
        WaveletDataImpl copied = copier.create(src);
        for (ParticipantId p : src.getParticipants()) {
          copied.addParticipant(p);
        }
        copied.setVersion(copied.getVersion());
        copied.setHashedVersion(src.getHashedVersion());
        copied.setLastModifiedTime(src.getLastModifiedTime());
        newData.addWavelet(copied);
      }
      return newData;
    }
View Full Code Here

            private final ObservableWaveletData.Factory<WaveletDataImpl> inner =
                WaveletDataImpl.Factory.create(docFactory);

            @Override
            public WaveletDataImpl create(ReadableWaveletData data) {
              WaveletDataImpl wavelet = inner.create(data);
              waveData.addWavelet(wavelet);
              return wavelet;
            }
          };
      WaveletFactory<OpBasedWavelet> waveletFactory = BasicFactories
View Full Code Here

    HashedVersion version = deserialize(snapshot.getVersion());
    long lmt = snapshot.getLastModifiedTime();
    long ctime = snapshot.getCreationTime();
    long lmv = version.getVersion();

    WaveletDataImpl waveletData =
        new WaveletDataImpl(id, creator, ctime, lmv, version, lmt, waveId, docFactory);
    for (String participant : snapshot.getParticipantId()) {
      waveletData.addParticipant(new ParticipantId(participant));
    }
    for (DocumentSnapshot docSnapshot : snapshot.getDocument()) {
      deserialize(waveletData, docSnapshot);
    }
    return waveletData;
View Full Code Here

    } finally {
      tx.rollback();
    }
    WaveletName waveletName = IdHack.udwWaveletNameFromConvObjectIdAndUdwObjectId(convId, udwId);
    // TODO(ohler): avoid serialization/deserialization here
    WaveletDataImpl waveletData = deserializeWavelet(waveletName, raw.getState().snapshot());
    Assert.check(raw.getVersion() == waveletData.getVersion(),
        "Raw version %s does not match wavelet version %s",
        raw.getVersion(), waveletData.getVersion());
    PrimitiveSupplement supplement = getPrimitiveSupplement(waveletData);
    ConvFields fields = getConvFields(convId);
    ParticipantId participantId = accountStore.get(udwOwner).getParticipantId();
    if (!fields.participants.contains(participantId)) {
      log.info(participantId + " is not currently a participant on " + convId
View Full Code Here

  }

  private ConvFields getConvFields(SlobId convId) throws PermanentFailure, RetryableFailure,
      WaveletLockedException {
    ConvFields fields = new ConvFields();
    WaveletDataImpl convData = loadConv(convId);
    fields.slobId = convId;
    fields.title = Util.extractTitle(convData);
    fields.creator = convData.getCreator().getAddress();
    fields.lastModifiedMillis = convData.getLastModifiedTime();
    fields.version = Versions.truncate(convData.getVersion());
    fields.waveletId = convData.getWaveletId();
    fields.conv = getConversation(convData);
    fields.participants = ImmutableList.copyOf(convData.getParticipants());
    fields.indexableText = fields.conv == null ? "" : TextRenderer.renderToText(fields.conv);
    fields.blipCount = fields.conv == null ? 0 : countBlips(fields.conv);
    return fields;
  }
View Full Code Here

    } finally {
      tx.rollback();
    }
    WaveletName waveletName = IdHack.convWaveletNameFromConvObjectId(id);
    // TODO(ohler): avoid serialization/deserialization here
    WaveletDataImpl waveletData = deserializeWavelet(waveletName,
        raw.getState().snapshot());
    Assert.check(raw.getVersion() == waveletData.getVersion(),
        "Raw version %s does not match wavelet version %s",
        raw.getVersion(), waveletData.getVersion());
    return waveletData;
  }
View Full Code Here

    } finally {
      tx.rollback();
    }
    WaveletName waveletName = IdHack.udwWaveletNameFromConvObjectIdAndUdwObjectId(convId, udwId);
    // TODO(ohler): avoid serialization/deserialization here
    WaveletDataImpl waveletData = deserializeWavelet(waveletName,
        raw.getState().snapshot());
    Assert.check(raw.getVersion() == waveletData.getVersion(),
        "Raw version %s does not match wavelet version %s",
        raw.getVersion(), waveletData.getVersion());
    return waveletData;
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.wave.data.impl.WaveletDataImpl

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.