Package org.waveprotocol.wave.model.id

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


    // Store the temporary id of the wavelet and rootblip so that future
    // operations can reference it.
    try {
      WaveId waveId = ApiIdSerializer.instance().deserialiseWaveId(waveletData.getWaveId());
      WaveletId waveletId =
          ApiIdSerializer.instance().deserialiseWaveletId(waveletData.getWaveletId());
      context.putWavelet(waveId, waveletId, newWavelet);
    } catch (InvalidIdException e) {
      throw new InvalidRequestException("Invalid id", operation, e);
    }
View Full Code Here


    return wavelets.get(waveletId);
  }

  @Override
  public void addWavelet(ObservableWaveletData wavelet) {
    WaveletId waveletId = wavelet.getWaveletId();
    Preconditions.checkArgument(
        !wavelets.containsKey(waveletId), "Duplicate wavelet id: %s", waveletId);
    wavelets.put(waveletId, wavelet);
  }
View Full Code Here

  }

  @Override
  public void onOperationChannelCreated(
      OperationChannel channel, ObservableWaveletData snapshot, Accessibility accessibility) {
    WaveletId wid = snapshot.getWaveletId();
    String id = ModernIdSerialiser.INSTANCE.serialiseWaveletId(wid);

    Preconditions.checkState(!channels.containsKey(id));
    channels.put(id, channel);
View Full Code Here

  public void popupLink(BlipView blipUi) {
    ConversationBlip blip = views.getBlip(blipUi);
    // TODO(Yuri Z.) Change to use the conversation model when the Conversation
    // exposes a reference to its ConversationView.
    WaveId waveId = blip.hackGetRaw().getWavelet().getWaveId();
    WaveletId waveletId;
    try {
      waveletId = DualIdSerialiser.MODERN.deserialiseWaveletId(blip.getConversation().getId());
    } catch (InvalidIdException e) {
      Window.alert(
          "Unable to link to this blip, invalid conversation id " + blip.getConversation().getId());
View Full Code Here

    ImmutableSet.Builder<WaveletId> results = ImmutableSet.builder();
    for(File deltaFile : deltaFiles) {
      String name = deltaFile.getName();
      String encodedWaveletId =
          name.substring(0, name.lastIndexOf(FileDeltaCollection.DELTAS_FILE_SUFFIX));
      WaveletId waveletId = FileUtils.waveletIdFromPathSegment(encodedWaveletId);
        FileDeltaCollection deltas = open(WaveletName.of(waveId, waveletId));
        HashedVersion endVersion = deltas.getEndVersion();
        if (endVersion != null && endVersion.getVersion() > 0) {
          results.add(waveletId);
        }
View Full Code Here

    if (participants == null) {
      participants = Collections.emptySet();
    }

    WaveId waveId;
    WaveletId waveletId;
    try {
      waveId = ApiIdSerializer.instance().deserialiseWaveId(
          String.format(TEMP_WAVE_ID_FORMAT, domain, ID_GENERATOR.nextInt()));
      waveletId = ApiIdSerializer.instance().deserialiseWaveletId(
          String.format(TEMP_WAVELET_ID_FORMAT, domain));
View Full Code Here

   * @return an instance of {@link Wavelet}.
   */
  public static Wavelet deserialize(OperationQueue operationQueue, Map<String, Blip> blips,
      Map<String, BlipThread> threads, WaveletData waveletData) {
    WaveId waveId;
    WaveletId waveletId;
    try {
      waveId = ApiIdSerializer.instance().deserialiseWaveId(waveletData.getWaveId());
      waveletId = ApiIdSerializer.instance().deserialiseWaveletId(waveletData.getWaveletId());
    } catch (InvalidIdException e) {
      throw new IllegalArgumentException(e);
View Full Code Here

      if (response.isError()) {
        throw new IOException(response.getErrorMessage());
      }
      WaveId waveId = ApiIdSerializer.instance().deserialiseWaveId(
          (String) response.getData().get(ParamsProperty.WAVE_ID));
      WaveletId waveletId = ApiIdSerializer.instance().deserialiseWaveletId(
          (String) response.getData().get(ParamsProperty.WAVELET_ID));
      String rootBlipId = (String) response.getData().get(ParamsProperty.BLIP_ID);

      Map<String, Blip> blips = new HashMap<String, Blip>();
      Map<String, BlipThread> threads = new HashMap<String, BlipThread>();
View Full Code Here

    assert container == getDocument().getParentElement(element);
    if (!WaveletBasedSupplement.WAVELET_TAG.equals(getDocument().getTagName(element))) {
      return;
    }

    WaveletId waveletId = valueOf(element);
    if (waveletId != null) {
      WaveletReadState existing = waveletSupplements.get(waveletId);
      if (existing == null) {
        WaveletReadState read =
            DocumentBasedWaveletReadState.create(router, element, waveletId, listener);
View Full Code Here

    }
  }

  public void onElementRemoved(E element) {
    if (WaveletBasedSupplement.WAVELET_TAG.equals(getDocument().getTagName(element))) {
      WaveletId waveletId = valueOf(element);
      if (waveletId != null) {
        WaveletReadState state = waveletSupplements.remove(waveletId);
        if (state == null) {
          // Not good - there was a read-state element and we weren't tracking
          // it...
View Full Code Here

TOP

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

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.