Package org.waveprotocol.box.server.frontend

Examples of org.waveprotocol.box.server.frontend.CommittedWaveletSnapshot


    waveletData.addParticipant(PARTICIPANT);
    HashedVersion hashedVersionZero = HASH_FACTORY.createVersionZero(WAVELET_NAME);
    wavelet = new RobotWaveletData(waveletData, hashedVersionZero);

    when(waveletProvider.checkAccessPermission(WAVELET_NAME, PARTICIPANT)).thenReturn(true);
    CommittedWaveletSnapshot snapshotAndVersion = new CommittedWaveletSnapshot(
        waveletData, hashedVersionZero);
    when(waveletProvider.getSnapshot(WAVELET_NAME)).thenReturn(snapshotAndVersion);

    boundOperationContext =
        new OperationContextImpl(waveletProvider, converter, conversationUtil, wavelet);
View Full Code Here


    List<byte[]> history =
        OperationUtil.getRequiredParameter(operation, ParamsProperty.RAW_DELTAS);
    WaveletName waveletName = WaveletName.of(waveId, waveletId);
    long importedFromVersion = -1;
    if (!history.isEmpty()) {
      CommittedWaveletSnapshot waveletSnapshot;
      try {
        waveletSnapshot = waveletProvider.getSnapshot(waveletName);
      } catch (WaveServerException ex) {
        LOG.info("Get wavelet snapshot", ex);
        context.constructErrorResponse(operation, ex.toString());
View Full Code Here

        OperationUtil.<String>getRequiredParameter(operation, ParamsProperty.WAVELET_ID));
    } catch (InvalidIdException ex) {
      throw new InvalidRequestException("Invalid id", operation, ex);
    }
    WaveletName waveletName = WaveletName.of(waveId, waveletId);
    CommittedWaveletSnapshot snapshot = context.getWaveletSnapshot(waveletName, participant);
    WaveletSnapshot protoSnapshot = SnapshotSerializer.serializeWavelet(snapshot.snapshot, snapshot.snapshot.getHashedVersion());
    WaveletSnapshotProtoImpl protoSnapshotImpl = new WaveletSnapshotProtoImpl(protoSnapshot);
    String jsonSnapshot = gson.toJson(protoSnapshotImpl.toGson(null, gson));
    Map<ParamsProperty, Object> data =
      ImmutableMap.<ParamsProperty, Object> of(ParamsProperty.RAW_SNAPSHOT, jsonSnapshot);
View Full Code Here

    }

    RobotWaveletData wavelet = openedWavelets.get(waveletName);
    if (wavelet == null) {
      // Open a wavelet from the server
      CommittedWaveletSnapshot snapshot = getWaveletSnapshot(waveletName, participant);
      if (snapshot == null) {
        if (waveletName.waveletId.equals(IdUtil.buildUserDataWaveletId(participant))) {
          // Usually the user data is created by the web client whenever user
          // opens a wavelet for the first time. However, if the wavelet is
          // fetched for the first time with Robot/Data API - user data should be
View Full Code Here

    if (waveletName.waveId.equals(getHostedWavelet().getWaveId())
        && waveletName.waveletId.equals(getHostedWavelet().getWaveletId())) {
      HashedVersion version =
          (currentVersionOverride != null) ? currentVersionOverride : HashedVersion.of(
              getHostedWavelet().getVersion(), JUNK_BYTES);
      return new CommittedWaveletSnapshot(getHostedWavelet(), getCommittedVersion());
    } else {
      return null;
    }
  }
View Full Code Here

    WaveletId waveletId = waveref.hasWaveletId() ? waveref.getWaveletId() : WaveletId.of(
        waveref.getWaveId().getDomain(), "conv+root");

    WaveletName waveletName = WaveletName.of(waveref.getWaveId(), waveletId);

    CommittedWaveletSnapshot committedSnapshot;
    try {
      if (!waveletProvider.checkAccessPermission(waveletName, requester)) {
        dest.sendError(HttpServletResponse.SC_FORBIDDEN);
        return;
      }
View Full Code Here

  public CommittedWaveletSnapshot getSnapshot() throws WaveletStateException {
    awaitLoad();
    acquireReadLock();
    try {
      checkStateOk();
      return new CommittedWaveletSnapshot(waveletState.getSnapshot(),
          waveletState.getLastPersistedVersion());
    } finally {
      releaseReadLock();
    }
  }
View Full Code Here

    WaveletId waveletId = waveref.hasWaveletId() ? waveref.getWaveletId() : WaveletId.of(
        waveref.getWaveId().getDomain(), "conv+root");

    WaveletName waveletName = WaveletName.of(waveref.getWaveId(), waveletId);

    CommittedWaveletSnapshot committedSnapshot;
    try {
      if (!waveletProvider.checkAccessPermission(waveletName, requester)) {
        dest.sendError(HttpServletResponse.SC_FORBIDDEN);
        return;
      }
View Full Code Here

  public CommittedWaveletSnapshot getSnapshot() throws WaveletStateException {
    awaitLoad();
    acquireReadLock();
    try {
      checkStateOk();
      return new CommittedWaveletSnapshot(waveletState.getSnapshot(),
          waveletState.getLastPersistedVersion());
    } finally {
      releaseReadLock();
    }
  }
View Full Code Here

    }

    RobotWaveletData wavelet = openedWavelets.get(waveletName);
    if (wavelet == null) {
      // Open a wavelet from the server
      CommittedWaveletSnapshot snapshot = getWaveletSnapshot(waveletName, participant);
      if (snapshot == null) {
        if (waveletName.waveletId.equals(buildUserDataWaveletId(participant))) {
          // Usually the user data is created by the web client whenever user
          // opens a wavelet for the first time. However, if the wavelet is
          // fetched for the first time with Robot/Data API - user data should be
View Full Code Here

TOP

Related Classes of org.waveprotocol.box.server.frontend.CommittedWaveletSnapshot

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.