Examples of WaveletName


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

    String fileName = getFileNameFromRequest(request);
    String waveRefStr = getWaveRefFromRequest(request);

    AttachmentMetadata metadata = service.getMetadata(attachmentId);
    WaveletName waveletName;

    if (metadata == null) {
      // Old attachments does not have metainfo.
      if (waveRefStr != null) {
        waveletName = AttachmentUtil.waveRef2WaveletName(waveRefStr);
View Full Code Here

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

        if (waveRefStr == null) {
          response.sendError(HttpServletResponse.SC_BAD_REQUEST, "No wave reference in request.");
          return;
        }

        WaveletName waveletName = AttachmentUtil.waveRef2WaveletName(waveRefStr);
        ParticipantId user = sessionManager.getLoggedInUser(request.getSession(false));
        boolean isAuthorized = waveletProvider.checkAccessPermission(waveletName, user);
        if (!isAuthorized) {
          response.sendError(HttpServletResponse.SC_FORBIDDEN);
          return;
View Full Code Here

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

  @Override
  public void waveletUpdate(ReadableWaveletData wavelet, DeltaSequence deltas) {
    WaveletId waveletId = wavelet.getWaveletId();
    WaveId waveId = wavelet.getWaveId();
    WaveletName waveletName = WaveletName.of(waveId, waveletId);
    if(LOG.isInfoLoggable()) {
      LOG.info("Got update for " + waveId + " " + waveletId);
    }

    // Find whether participants were added/removed and update the views
View Full Code Here

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

  }

  /** Dispatches an update to the appropriate wave stream. */
  @Override
  public void onWaveletUpdate(ProtocolWaveletUpdate message) {
    WaveletName wavelet = deserialize(message.getWaveletName());

    // Route to the appropriate stream handler.
    WaveWebSocketCallback stream = streams.get(wavelet.waveId);
    if (stream != null) {
      boolean drop;
View Full Code Here

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

        callback.onFailure(FederationErrors.badRequest(
            "wavelet-update element missing from message: " + updateMessage));
        continue;
      }

      final WaveletName waveletName;
      try {
        waveletName = XmppUtil.waveletNameCodec.uriToWaveletName(
            waveletUpdate.attributeValue("wavelet-name"));
      } catch (EncodingException e) {
        callback.onFailure(FederationErrors.badRequest(
View Full Code Here

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

    } catch (WaveServerException e1) {
      waveletIds = Sets.newHashSet();
      LOG.warning("Failed to retrieve visible wavelets for " + loggedInUser, e1);
    }
    for (WaveletId waveletId : waveletIds) {
      WaveletName waveletName = WaveletName.of(waveId, waveletId);
      // Ensure that implicit participants will also receive updates.
      // TODO (Yuri Z.) If authorizing participant was removed from the wave
      // (the shared domain participant), then all implicit participant that
      // were authorized should be unsubsrcibed.
      waveletInfo.notifyAddedImplcitParticipant(waveletName, loggedInUser);
      // The WaveletName by which the waveletProvider knows the relevant deltas

      // TODO(anorth): if the client provides known wavelets, calculate
      // where to start sending deltas from.

      CommittedWaveletSnapshot snapshotToSend;

      // Send a snapshot of the current state.
      // TODO(anorth): calculate resync point if the client already knows
      // a snapshot.
      try {
        snapshotToSend = waveletProvider.getSnapshot(waveletName);
      } catch (WaveServerException e) {
        LOG.warning("Failed to retrieve snapshot for wavelet " + waveletName, e);
        openListener.onFailure("Wave server failure retrieving wavelet");
        return;
      }

      LOG.info("snapshot in response is: " + (snapshotToSend != null));
      if (snapshotToSend == null) {
        // Send deltas.
        openListener.onUpdate(waveletName, snapshotToSend, DeltaSequence.empty(), null, null,
            channelId);
      } else {
        // Send the snapshot.
        openListener.onUpdate(waveletName, snapshotToSend, DeltaSequence.empty(),
            snapshotToSend.committedVersion, null, channelId);
      }
    }

    WaveletName dummyWaveletName = createDummyWaveletName(waveId);
    if (waveletIds.size() == 0) {
      // Send message with just the channel id.
      LOG.info("sending just a channel id for " + dummyWaveletName);
      openListener.onUpdate(dummyWaveletName, null, DeltaSequence.empty(), null, null, channelId);
    }
View Full Code Here

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

  public void waveletUpdate(ReadableWaveletData wavelet, DeltaSequence newDeltas) {
    if (newDeltas.isEmpty()) {
      return;
    }

    WaveletName waveletName = WaveletName.of(wavelet.getWaveId(), wavelet.getWaveletId());

    if(waveletInfo.getCurrentWaveletVersion(waveletName).getVersion() == 0 && LOG.isWarningLoggable()) {
      LOG.warning("Wavelet does not appear to have been initialized by client. Continuing anyway.");
    }
View Full Code Here

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

    }
  }

  @VisibleForTesting
  static WaveletName createDummyWaveletName(WaveId waveId) {
    final WaveletName dummyWaveletName =
      WaveletName.of(waveId, WaveletId.of(waveId.getDomain(), "dummy+root"));
    return dummyWaveletName;
  }
View Full Code Here

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

  }

  @Override
  public void submit(RpcController controller, ProtocolSubmitRequest request,
      final RpcCallback<ProtocolSubmitResponse> done) {
    WaveletName waveletName = null;
    try {
      waveletName = ModernIdSerialiser.INSTANCE.deserialiseWaveletName(request.getWaveletName());
    } catch (InvalidIdException e) {
      LOG.warning("Invalid id in submit", e);
      controller.setFailed(e.getMessage());
View Full Code Here

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

    AttachmentsResponse.Builder attachmentsResponse = AttachmentsResponse.newBuilder();
    for (AttachmentId id : attachmentIds) {
      AttachmentMetadata metadata = service.getMetadata(id);
      if (metadata != null) {
        boolean isAuthorized = false;
        WaveletName waveletName = AttachmentUtil.waveRef2WaveletName(metadata.getWaveRef());
        try {
          isAuthorized = waveletProvider.checkAccessPermission(waveletName, user);
        } catch (WaveServerException e) {
          LOG.warning("Problem while authorizing user: " + user + " for wavelet: " + waveletName, e);
        }
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.