Package org.waveprotocol.wave.model.id

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


      @Override
      public LoadingCache<WaveletId, PerWavelet> load(final WaveId waveId) {
        return CacheBuilder.newBuilder().build(new CacheLoader<WaveletId, PerWavelet>() {
          @Override
          public PerWavelet load(WaveletId waveletId) {
            WaveletName waveletName = WaveletName.of(waveId, waveletId);
            return new PerWavelet(waveletName, hashedVersionFactory
                .createVersionZero(waveletName));
          }
        });
      }
View Full Code Here


      entrySet = perWavelet.get(subscription.getWaveId()).asMap().entrySet();
    } catch (ExecutionException ex) {
      throw new RuntimeException(ex);
    }
    for (Entry<WaveletId, PerWavelet> entry : entrySet) {
      WaveletName waveletName = WaveletName.of(subscription.getWaveId(), entry.getKey());
      if (subscription.includes(entry.getKey())
          && waveletProvider.checkAccessPermission(waveletName, loggedInUser)) {
        visible.add(entry.getKey());
      }
    }
View Full Code Here

    WaveId waveId = waveRef.getWaveId();
    WaveletId waveletId =
        waveRef.getWaveletId() != null ? waveRef.getWaveletId() : WaveletId.of(waveId.getDomain(),
            IdConstants.CONVERSATION_ROOT_WAVELET);

    WaveletName waveletName = WaveletName.of(waveId, waveletId);
    return waveletName;
  }
View Full Code Here

      udwOwner = new StableUserId(metadata.getUdwMetadata().getOwner());
      raw = l.reconstruct(null);
    } 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());
View Full Code Here

      MutationLog l = convStore.create(tx, id);
      raw = l.reconstruct(null);
    } 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",
View Full Code Here

      MutationLog l = udwStore.create(tx, udwId);
      raw = l.reconstruct(null);
    } 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",
View Full Code Here

      Multimap<Pair<SourceInstance, WaveletName>, ImportSharingMode> importsInProgress)
      throws RetryableFailure, PermanentFailure {
    ImmutableList.Builder<ImportWaveletDisplayRecord> out = ImmutableList.builder();
    List<RemoteConvWavelet> wavelets = perUserTable.get().getAllWavelets(tx, userId);
    for (RemoteConvWavelet wavelet : wavelets) {
      WaveletName waveletName = WaveletName.of(
          WaveId.deserialise(wavelet.getDigest().getWaveId()),
          wavelet.getWaveletId());
      out.add(
          new ImportWaveletDisplayRecord(
              wavelet.getSourceInstance(),
View Full Code Here

  public LoadedWave loadStaticAtVersion(SlobId convObjectId, @Nullable Long version)
      throws IOException, AccessDeniedException, SlobNotFoundException {
    Preconditions.checkNotNull(convObjectId, "Null convObjectId");
    String rawConvSnapshot = convStore.loadAtVersion(convObjectId, version);
    WaveletName convWaveletName = IdHack.convWaveletNameFromConvObjectId(convObjectId);
    WaveletDataImpl convWavelet = deserializeWavelet(convWaveletName, rawConvSnapshot);
    // TODO(ohler): Determine if it's better UX if we load the UDW here as well.
    return waveWithoutUdw(convObjectId, null, convWavelet);
  }
View Full Code Here

    Pair<ConnectResult, String> convPair = convStore.connect(convObjectId, clientId);
    ConnectResult convResult = convPair.getFirst();
    String rawConvSnapshot = convPair.getSecond();
    log(convObjectId, convResult);

    WaveletName convWaveletName = IdHack.convWaveletNameFromConvObjectId(convObjectId);

    // The most recent version of wavelet to get list of documents from.
    WaveletDataImpl convWavelet = deserializeWavelet(convWaveletName, rawConvSnapshot);

    long convVersion = convResult.getVersion();
    Assert.check(convVersion == convWavelet.getVersion(),
        "ConnectResult revision %s does not match wavelet version %s",
        convVersion, convWavelet.getVersion());

    if (!enableUdw) {
      return waveWithoutUdw(convObjectId, convResult, convWavelet);
    } else {
      // Now we go and load some of the history in order to render diffs.
      // For fully read or unread blips, we don't need to load any history.
      // So the approach here is to find all the blips that are partially
      // read, and get the smallest version.

      // TODO(ohler): This should be getOrCreateAndConnect(), so that we can avoid
      // reconstructing the state of the wavelet that we just created.  But
      // snapshot caching would help with this as well, so we should probably do
      // that first.
      SlobId udwId = waveletCreator.getOrCreateUdw(convObjectId);
      Pair<ConnectResult, String> udwPair;
      try {
        udwPair = udwStore.connect(udwId, clientId);
      } catch (SlobNotFoundException e) {
        throw new RuntimeException("UDW disappeared right after getOrCreateUdw(): " + udwId);
      }
      ConnectResult udwResult = udwPair.getFirst();
      WaveletName udwWaveletName = IdHack.udwWaveletNameFromConvObjectIdAndUdwObjectId(
          convObjectId, udwId);
      WaveletDataImpl udw = deserializeWavelet(udwWaveletName, udwPair.getSecond());
      WalkaroundWaveletSnapshot udwSnapshot = serializer.createWaveletMessage(udw);
      LoadedUdw loadedUdw = new LoadedUdw(udwId, udwResult, udwSnapshot);
      if (!enableDiffOnOpen) {
View Full Code Here

  public List<ImportTaskPayload> fetchAttachments(FetchAttachmentsAndImportWaveletTask task)
      throws PermanentFailure {
    ImportWaveletTask waveletTask = task.getOriginalImportTask();
    SourceInstance instance = sourceInstanceFactory.parseUnchecked(waveletTask.getInstance());
    WaveletName waveletName = WaveletName.of(
        WaveId.deserialise(waveletTask.getWaveId()),
        WaveletId.deserialise(waveletTask.getWaveletId()));
    LinkedList<RemoteAttachmentInfo> toImport = Lists.newLinkedList(task.getToImport());
    log.info("Need attachments for " + waveletName + ": " + toImport);
    int infosFetchedThisTask = 0;
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.id.WaveletName

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.