Examples of WaveId


Examples of org.waveprotocol.wave.model.id.WaveId

    int[] saw_wave = new int[10];

    for (int i = 0; i < 10; i++) {
      SearchResult results = searchProvider.search(USER1, "in:inbox", i, 1);
      assertEquals(1, results.getNumResults());
      WaveId waveId = WaveId.deserialise(results.getDigests().get(0).getWaveId());
      int index = Integer.parseInt(waveId.getId());
      saw_wave[index]++;
    }

    for (int i = 0; i < 10; i++) {
      // Each wave should appear exactly once in the results
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveId

  @Override
  public DigestProxy getDigest(int index) {
    Preconditions.checkState(outstanding == null);
    DigestSnapshot result = results.get(index);
    WaveId waveId = result.getWaveId();
    String id = ModernIdSerialiser.INSTANCE.serialiseWaveId(waveId);
    DigestProxy proxy = digests.get(id);
    if (proxy == null) {
      proxy = new DigestProxy(result);
      digests.put(id, proxy);
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveId

    IndexSearcher indexSearcher = searcherManager.acquire();
    try {
      TopDocs hints = indexSearcher.search(participantQuery, MAX_WAVES, LMT_ASC_SORT);
      for (ScoreDoc hint : hints.scoreDocs) {
        Document document = indexSearcher.doc(hint.doc);
        WaveId waveId = WaveId.deserialise(document.get(WAVEID.toString()));
        WaveletId waveletId = WaveletId.deserialise(document.get(WAVELETID.toString()));
        userWavesViewMap.put(waveId, waveletId);
      }
    } catch (IOException e) {
      LOG.log(Level.WARNING, "Search failed: " + user, e);
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveId

  public SimpleWaveStore() {
  }

  @Override
  public void add(WaveContext wave) {
    WaveId id = wave.getWave().getWaveId();
    Preconditions.checkArgument(!waves.containsKey(id));
    waves.put(id, wave);
    fireOnWaveOpened(wave);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveId

    fireOnWaveOpened(wave);
  }

  @Override
  public void remove(WaveContext wave) {
    WaveId id = wave.getWave().getWaveId();
    Preconditions.checkArgument(waves.get(id) == wave);
    waves.remove(id);
    fireOnWaveClosed(wave);
  }
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveId

   * @throws InvalidIdException
   */
  public static WaveViewData deserializeWave(WaveViewSnapshot snapshot,
      DocumentFactory<?> docFactory) throws OperationException, InvalidParticipantAddress,
      InvalidIdException {
    WaveId waveId = ModernIdSerialiser.INSTANCE.deserialiseWaveId(snapshot.getWaveId());
    Collection<ObservableWaveletData> wavelets = CollectionUtils.newArrayList();
    for (WaveletSnapshot s : snapshot.getWavelet()) {
      wavelets.add(deserializeWavelet(s, waveId, docFactory));
    }

View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveId

  }

  private void renderDigests() {
    isRenderingInProgress = true;
    // Preserve selection on re-rendering.
    WaveId toSelect = selected != null ? digestUis.get(selected).getWaveId() : null;
    searchUi.clearDigests();
    digestUis.clear();
    setSelected(null);
    for (int i = 0, size = search.getMinimumTotal(); i < size; i++) {
      Digest digest = search.getDigest(i);
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveId

        int msgs = Math.min(5, r.nextInt(20));
        int unread = Math.max(0, r.nextInt(msgs + 5) - 5);
        ParticipantId author = allParticipants.get(r.nextInt(allParticipants.size()));
        List<ParticipantId> participants = randomSubsequence(r, allParticipants);
        participants.remove(author);
        WaveId wid = WaveId.of(domain, "fake" + i);
        double lmt = now - r.nextDouble() * week;
        digests.add(new DigestSnapshot(title, snippet, wid, author, participants, lmt, unread, msgs));
      }
      return digests;
    }
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveId

  public synchronized void remakeIndex() throws WaveletStateException, WaveServerException {
    waveMap.loadAllWavelets();

    ExceptionalIterator<WaveId, WaveServerException> witr = waveletProvider.getWaveIds();
    while (witr.hasNext()) {
      WaveId waveId = witr.next();
      for (WaveletId waveletId : waveletProvider.getWaveletIds(waveId)) {
        WaveletName waveletName = WaveletName.of(waveId, waveletId);

        // Required to call this method to load the wavelet into memory.
        waveletProvider.getSnapshot(waveletName);
View Full Code Here

Examples of org.waveprotocol.wave.model.id.WaveId

      LinkedHashMultimap<WaveId, WaveletId> currentUserWavesView, JsonArray docsJson) {
    Iterator<JsonElement> docJsonIterator = docsJson.iterator();
    while (docJsonIterator.hasNext()) {
      JsonObject docJson = docJsonIterator.next().getAsJsonObject();

      WaveId waveId = WaveId.deserialise(docJson.getAsJsonPrimitive(WAVE_ID).getAsString());
      WaveletId waveletId =
          WaveletId.deserialise(docJson.getAsJsonPrimitive(WAVELET_ID).getAsString());
      currentUserWavesView.put(waveId, waveletId);
    }
  }
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.