Examples of WaveletName


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

  }

  @Override
  public OpBasedWavelet openWavelet(WaveId waveId, WaveletId waveletId, ParticipantId participant)
      throws InvalidRequestException {
    WaveletName waveletName;
    if (waveId.getId().startsWith(TEMP_ID_MARKER)) {
      WaveletName tempWaveletName = WaveletName.of(waveId, waveletId);
      waveletName = tempWaveletNameMap.get(tempWaveletName);
    } else {
      waveletName = WaveletName.of(waveId, waveletId);
    }
View Full Code Here

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

  }

  @Override
  public ObservableConversationView openConversation(WaveId waveId, WaveletId waveletId,
      ParticipantId participant) throws InvalidRequestException {
    WaveletName waveletName = WaveletName.of(waveId, waveletId);

    if (!openedConversations.containsKey(waveletName)) {
      openedConversations.put(
          waveletName, Maps.<ParticipantId, ObservableConversationView> newHashMap());
    }
View Full Code Here

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

    try {
      WaveId waveId = ApiIdSerializer.instance().deserialiseWaveId(
          OperationUtil.<String>getRequiredParameter(operation, ParamsProperty.WAVE_ID));
      ImmutableSet<WaveletId> ids = waveletProvider.getWaveletIds(waveId);
      for (WaveletId waveletId: ids) {
        WaveletName waveletName = WaveletName.of(waveId, waveletId);
        if (waveletProvider.checkAccessPermission(waveletName, participant)) {
          waveletIds.add(waveletId);
        }
      }
    } catch (InvalidIdException ex) {
View Full Code Here

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

    } catch (InvalidIdException ex) {
      throw new InvalidRequestException("Invalid id", operation, ex);
    }
    startVersion = getVersionParameter(operation, ParamsProperty.FROM_VERSION);
    endVersion = getVersionParameter(operation, ParamsProperty.TO_VERSION);
    WaveletName waveletName = WaveletName.of(waveId, waveletId);
    getDeltas(context, waveletName, participant, startVersion, endVersion, new RawDeltasListener() {

          @Override
          public void onSuccess(List<byte[]> rawDeltas, byte[] rawTargetVersion) {
            Map<ParamsProperty, Object> data = ImmutableMap.<ParamsProperty, Object> of(
View Full Code Here

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

   * @throws OperationException if an update for a new wavelet could not be
   *         processed.
   */
  void waveletUpdate(ReadableWaveletData wavelet, DeltaSequence deltas)
      throws OperationException {
    WaveletName waveletName = WaveletDataUtil.waveletNameOf(wavelet);

    synchronized (waveletAndDeltasMap) {
      // This returns a view which we can append new delta collections to.
      List<WaveletAndDeltas> wavelets = waveletAndDeltasMap.get(waveletName);

View Full Code Here

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

    Preconditions.checkArgument(updatedSnapshot.getVersion() == newEndVersion.getVersion(),
        String.format("Version of snapshot %s doesn't match the HashedVersion %s",
            updatedSnapshot.getVersion(), newEndVersion));
    Preconditions.checkArgument(areContiguousToCurrentVersion(newDeltas), String.format(
        "Deltas are not contiguous to the current version(%s) %s", getVersionAfterDeltas(), deltas));
    WaveletName updatedWaveletName = WaveletDataUtil.waveletNameOf(updatedSnapshot);
    Preconditions.checkArgument(updatedWaveletName.equals(waveletName),
        String.format(
            "Updated wavelet doesn't have the same name as with which this class has been "
                + "instantiated. %s != %s", updatedWaveletName, waveletName));

    // TODO(ljvderijk): This should actually be applying the deltas, however
View Full Code Here

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

   *        wavelet provider.
   */
  public static void submitDeltas(OperationResults results, WaveletProvider waveletProvider,
      SubmitRequestListener requestListener) {
    for (Entry<WaveletName, RobotWaveletData> entry : results.getOpenWavelets().entrySet()) {
      WaveletName waveletName = entry.getKey();
      RobotWaveletData w = entry.getValue();
      for (WaveletDelta delta : w.getDeltas()) {
        ProtocolWaveletDelta protocolDelta = CoreWaveletOperationSerializer.serialize(delta);
        waveletProvider.submitRequest(waveletName, protocolDelta, requestListener);
      }
View Full Code Here

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

  private static final HashedVersionFactory HASH_FACTORY = new HashedVersionFactoryImpl(URI_CODEC);

  public void testWaveletRoundtrip() throws Exception {
    WaveletData expected = TestDataUtil.createSimpleWaveletData();
    WaveletName name = WaveletName.of(expected.getWaveId(), expected.getWaveletId());
    HashedVersion version = HASH_FACTORY.createVersionZero(name);

    WaveletSnapshot snapshot = SnapshotSerializer.serializeWavelet(expected, version);
    WaveletData actual = SnapshotSerializer.deserializeWavelet(snapshot, expected.getWaveId());
View Full Code Here

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

   * Create a wavelet data object for testing.
   *
   * @return a simple wavelet.
   */
  public static WaveletData createSimpleWaveletData() {
    WaveletName name = WaveletName.of(
        WaveId.of("example.com", "w+abc123"), WaveletId.of("example.com", "conv+root"));
    ParticipantId creator = ParticipantId.ofUnsafe("sam@example.com");
    long time = 1234567890;

    WaveletData wavelet = WaveletDataUtil.createEmptyWavelet(name, creator,
View Full Code Here

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

  }

  public void testSearchWaveReturnsWaveWithImplicitParticipant() throws Exception {
    ParticipantId sharedDomainParticipantId =
        ParticipantIdUtil.makeUnsafeSharedDomainParticipantId(DOMAIN);
    WaveletName waveletName =
      WaveletName.of(WaveId.of(DOMAIN, String.valueOf(1)), WAVELET_ID);
    // Implicit participant in this wave.
    submitDeltaToNewWavelet(waveletName, USER1,
        addParticipantToWavelet(sharedDomainParticipantId, waveletName));
    waveletName = WaveletName.of(WaveId.of(DOMAIN, String.valueOf(2)), WAVELET_ID);
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.