Examples of ObservableWaveletData


Examples of org.waveprotocol.wave.model.wave.data.ObservableWaveletData

    ParticipantId author = ParticipantId.of(snapshot.getCreator());
    WaveletId waveletId =
        ModernIdSerialiser.INSTANCE.deserialiseWaveletId(snapshot.getWaveletId());
    long creationTime = snapshot.getCreationTime();

    ObservableWaveletData wavelet = factory.create(new EmptyWaveletSnapshot(waveId, waveletId,
            author, WaveletOperationSerializer.deserialize(snapshot.getVersion()),
            creationTime));

    for (String participant : snapshot.getParticipantId()) {
      wavelet.addParticipant(ParticipantId.of(participant));
    }

    for (DocumentSnapshot document : snapshot.getDocument()) {
      addDocumentSnapshotToWavelet(document, wavelet);
    }

    wavelet.setVersion((long) snapshot.getVersion().getVersion());
    wavelet.setLastModifiedTime(snapshot.getLastModifiedTime());
    // The creator and creation time are set when the empty wavelet template is
    // created above.

    return wavelet;
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.ObservableWaveletData

  public void onReadStateChanged() {
    fireOnChanged();
  }

  private void updateSnippet(ObservableWavelet wavelet) {
    ObservableWaveletData waveletData = wavelet.getWaveletData();
    if (waveletData != null){
      Set<String> docsIds = waveletData.getDocumentIds();
      if (!docsIds.contains("conversation")) {
        return;
      }
      snippet = Snippets.renderSnippet(waveletData, Snippets.DIGEST_SNIPPET_LENGTH).trim();
      String title = getTitle();
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.ObservableWaveletData

    Digest digest;

    // Note: the indexing infrastructure only supports single-conversation
    // waves, and requires raw wavelet access for snippeting.
    ObservableWaveletData root = null;
    ObservableWaveletData other = null;
    ObservableWaveletData udw = null;
    for (ObservableWaveletData waveletData : wave.getWavelets()) {
      WaveletId waveletId = waveletData.getWaveletId();
      if (IdUtil.isConversationRootWaveletId(waveletId)) {
        root = waveletData;
      } else if (IdUtil.isConversationalId(waveletId)) {
        other = waveletData;
      } else if (IdUtil.isUserDataWavelet(waveletId)
          && waveletData.getCreator().equals(participant)) {
        udw = waveletData;
      }
    }

    ObservableWaveletData convWavelet = root != null ? root : other;
    SupplementedWave supplement = null;
    ObservableConversationView conversations = null;
    if (convWavelet != null) {
      OpBasedWavelet wavelet = OpBasedWavelet.createReadOnly(convWavelet);
      if (WaveletBasedConversation.waveletHasConversation(wavelet)) {
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.ObservableWaveletData

    ParticipantId author = ParticipantId.of(snapshot.getCreator());
    WaveletId waveletId = ModernIdSerialiser.INSTANCE.deserialiseWaveletId(snapshot.getWaveletId());
    long creationTime = snapshot.getCreationTime();

    ObservableWaveletData wavelet = factory.create(new EmptyWaveletSnapshot(waveId, waveletId,
        author, CoreWaveletOperationSerializer.deserialize(snapshot.getVersion()), creationTime));

    for (String participant : snapshot.getParticipantIdList()) {
      wavelet.addParticipant(getParticipantId(participant));
    }

    for (DocumentSnapshot document : snapshot.getDocumentList()) {
      addDocumentSnapshotToWavelet(document, wavelet);
    }

    wavelet.setVersion(snapshot.getVersion().getVersion());
    wavelet.setLastModifiedTime(snapshot.getLastModifiedTime());
    // The creator and creation time are set when the empty wavelet template is
    // created above.

    return wavelet;
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.ObservableWaveletData

   */
  public static ObservableWaveletData buildWaveletFromFirstDelta(WaveletName waveletName,
      TransformedWaveletDelta delta) throws OperationException {
    Preconditions.checkArgument(delta.getAppliedAtVersion() == 0,
        "first delta has non-zero version: %s", delta.getAppliedAtVersion());
    ObservableWaveletData wavelet =
        createEmptyWavelet(
            waveletName,
            delta.getAuthor(), // creator
            HashedVersion.unsigned(0), // garbage hash, is overwritten by first delta below
            delta.getApplicationTimestamp()); // creation time
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.ObservableWaveletData

   *        from version zero.
   */
  public static ObservableWaveletData buildWaveletFromDeltas(WaveletName waveletName,
      Iterator<TransformedWaveletDelta> deltas) throws OperationException {
    Preconditions.checkArgument(deltas.hasNext(), "empty deltas");
    ObservableWaveletData wavelet = buildWaveletFromFirstDelta(waveletName, deltas.next());
    while (deltas.hasNext()) {
      TransformedWaveletDelta delta = deltas.next();
      applyWaveletDelta(delta, wavelet);
    }
    return wavelet;
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.ObservableWaveletData

          CoreWaveletOperationSerializer.deserialize(document.getDocumentOperation());
      coreWavelet.modifyDocument(document.getDocumentId(), op);
    }

    HashedVersion hashedVersion = CoreWaveletOperationSerializer.deserialize(version);
    ObservableWaveletData immutableWaveletData =
        DataUtil.fromCoreWaveletData(coreWavelet, hashedVersion, SchemaCollection.empty());

    ObservableWaveletData wavelet = WaveletDataUtil.copyWavelet(immutableWaveletData);

    for (String participant : snapshot.getParticipantIdList()) {
      wavelet.addParticipant(new ParticipantId(participant));
    }

    return wavelet;
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.ObservableWaveletData

      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

Examples of org.waveprotocol.wave.model.wave.data.ObservableWaveletData

      return result;
    }
    for (WaveViewData wave : results) {
      // Note: the indexing infrastructure only supports single-conversation
      // waves, and requires raw wavelet access for snippeting.
      ObservableWaveletData root = null;
      ObservableWaveletData other = null;
      ObservableWaveletData udw = null;
      for (ObservableWaveletData waveletData : wave.getWavelets()) {
        WaveletId waveletId = waveletData.getWaveletId();
        if (IdUtil.isConversationRootWaveletId(waveletId)) {
          root = waveletData;
        } else if (IdUtil.isConversationalId(waveletId)) {
          other = waveletData;
        } else if (IdUtil.isUserDataWavelet(waveletId)) {
          // assume this is the user data wavelet for the right user.
          udw = waveletData;
        }
      }

      ObservableWaveletData convWavelet = root != null ? root : other;
      SupplementedWave supplement = null;
      ObservableConversationView conversations = null;
      if (convWavelet != null) {
        OpBasedWavelet wavelet = OpBasedWavelet.createReadOnly(convWavelet);
        if (WaveletBasedConversation.waveletHasConversation(wavelet)) {
View Full Code Here

Examples of org.waveprotocol.wave.model.wave.data.ObservableWaveletData

    }

    // Create the new channel, and fake an initial snapshot.
    // TODO(anorth): inject a clock for providing timestamps.
    HashedVersion v0 = hashFactory.createVersionZero(WaveletName.of(waveId, waveletId));
    final ObservableWaveletData emptySnapshot =
        dataFactory.create(
            new EmptyWaveletSnapshot(waveId, waveletId, creator, v0, System.currentTimeMillis()));

    try {
      boolean dropAdditionalSnapshot = true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.