Package org.waveprotocol.wave.model.operation.wave

Examples of org.waveprotocol.wave.model.operation.wave.RemoveParticipant


    TransformedWaveletDelta delta =
        new TransformedWaveletDelta(ALEX, V1, 0L, Arrays.asList(addBobOp));

    wavelet = WaveletAndDeltas.create(waveletData, DeltaSequence.of(delta));
    addCarolOp = new AddParticipant(new WaveletOperationContext(ALEX, 0L, 1, V2), CAROL);
    removeAlexOp = new RemoveParticipant(new WaveletOperationContext(ALEX, 0L, 1, V3), ALEX);
  }
View Full Code Here


    throw new UnsupportedOperationException();
  }

  @Override
  public void visitAddParticipant(AddParticipant op) {
    inverse = new RemoveParticipant(reverseContext, op.getParticipantId());
  }
View Full Code Here

   * Creates and consumes a {@link RemoveParticipant} operation.
   */
  @Override
  public void removeParticipant(ParticipantId participant) {
    if (wavelet.getParticipants().contains(participant)) {
      authoriseApplyAndSend(new RemoveParticipant(createContext(), participant));
    }
  }
View Full Code Here

  public void testAddParticipant() {
    assertReversible(new AddParticipant(OP_CONTEXT, new ParticipantId("kalman@google.com")));
  }

  public void testRemoveParticipant() {
    assertReversible(new RemoveParticipant(OP_CONTEXT, new ParticipantId("kalman@google.com")));
  }
View Full Code Here

    if (protobufOp.hasNoOp()) {
      return new NoOp(ctx);
    } else if (protobufOp.hasAddParticipant()) {
      return new AddParticipant(ctx, new ParticipantId(protobufOp.getAddParticipant()));
    } else if (protobufOp.hasRemoveParticipant()) {
      return new RemoveParticipant(ctx, new ParticipantId(protobufOp.getRemoveParticipant()));
    } else if (protobufOp.hasMutateDocument()) {
      return new WaveletBlipOperation(protobufOp.getMutateDocument().getDocumentId(),
          new BlipContentOperation(ctx, deserialize(protobufOp.getMutateDocument()
              .getDocumentOperation())));
    } else {
View Full Code Here

    return new AddParticipant(new WaveletOperationContext(author, 0L, 1L), participant);
  }

  /** Creates a RemoveParticipant operation. */
  public RemoveParticipant removeParticipant(ParticipantId participant) {
    return new RemoveParticipant(new WaveletOperationContext(author, 0L, 1L), participant);
  }
View Full Code Here

      return new NoOp(context);
    } else if (type.equals(WAVELET_OP_ADD_PARTICIPANT)) {
      return new AddParticipant(context,
          deserializeParicipantId((DBObject) dbObject.get(FIELD_PARTICIPANT)));
    } else if (type.equals(WAVELET_OP_REMOVE_PARTICIPANT)) {
      return new RemoveParticipant(context,
          deserializeParicipantId((DBObject) dbObject.get(FIELD_PARTICIPANT)));
    } else if (type.equals(WAVELET_OP_WAVELET_BLIP_OPERATION)) {
      return new WaveletBlipOperation((String) dbObject.get(FIELD_BLIPID),
          deserializeBlipContentOperation((DBObject) dbObject.get(FIELD_BLIPOP), context));
    } else {
View Full Code Here

  private WaveletOperation coreWaveletOpsToWaveletOps(CoreWaveletOperation op,
      WaveletOperationContext context) {
    if (op instanceof CoreRemoveParticipant) {
      ParticipantId participantId = ((CoreRemoveParticipant) op).getParticipantId();
      return new RemoveParticipant(context, participantId);
    } else if (op instanceof CoreAddParticipant) {
      ParticipantId participantId = ((CoreAddParticipant) op).getParticipantId();
      return new AddParticipant(context, participantId);
    } else if (op instanceof CoreWaveletDocumentOperation) {
      CoreWaveletDocumentOperation waveletDocOp = (CoreWaveletDocumentOperation) op;
View Full Code Here

    if (protobufOp.hasNoOp()) {
      return new NoOp(context);
    } else if (protobufOp.hasAddParticipant()) {
      return new AddParticipant(context, new ParticipantId(protobufOp.getAddParticipant()));
    } else if (protobufOp.hasRemoveParticipant()) {
      return new RemoveParticipant(context, new ParticipantId(protobufOp.getRemoveParticipant()));
    } else if (protobufOp.hasMutateDocument()) {
      return new WaveletBlipOperation(protobufOp.getMutateDocument().getDocumentId(),
          new BlipContentOperation(context,
              deserialize(protobufOp.getMutateDocument().getDocumentOperation())));
    } else {
View Full Code Here

    return new AddParticipant(getContext(author, timestampMillis), ParticipantId.ofUnsafe(userId));
  }

  public static WaveletOperation newRemoveParticipant(
      String author, long timestampMillis, String userId) {
    return new RemoveParticipant(getContext(author, timestampMillis),
        ParticipantId.ofUnsafe(userId));
  }
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.operation.wave.RemoveParticipant

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.