Package org.waveprotocol.wave.model.wave

Examples of org.waveprotocol.wave.model.wave.ParticipantId


    SearchResult results = searchProvider.search(USER2, "in:inbox", 0, 20);
    assertEquals(0, results.getNumResults());
  }

  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,
View Full Code Here


   * @throws RemovedAuthorException if the wavelet operation was issued by the
   *         participant being removed.
   */
  private static void checkParticipantRemoval(RemoveParticipant removeParticipant,
      WaveletOperation operation) throws RemovedAuthorException {
    ParticipantId participantId = removeParticipant.getParticipantId();
    if (participantId.equals(operation.getContext().getCreator())) {
      throw new RemovedAuthorException(participantId.getAddress());
    }
  }
View Full Code Here

   * @throws TransformException if the same participant is being concurrently
   *         added and removed.
   */
  private static void checkParticipantRemovalAndAddition(RemoveParticipant removeParticipant,
      AddParticipant addParticipant) throws TransformException {
    ParticipantId participantId = removeParticipant.getParticipantId();
    if (participantId.equals(addParticipant.getParticipantId())) {
      throw new TransformException("Transform error involving participant: " +
          participantId.getAddress());
    }
  }
View Full Code Here

        String[] args = commandLine.getArgs();
        userId = args[1];
        String newPassword = args[2];
        // Add domain to the user id if needed.
        userId = userId + (userId.contains("@") ? "" : "@" + getWaveDomain());
        ParticipantId participantId = ParticipantId.of(userId);
        changeUserPassword(newPassword, participantId, accountStore);
        robotMessage =
            String.format("Changed password for user %s, the new password is: %s\n", userId,
                newPassword);
        LOG.log(Level.INFO, "Password changed for user " + userId + " by " + adminId);
View Full Code Here

          String.format("User %s does not belong to the @%s domain\n", modifiedBy,
              getWaveDomain());
    } else {
      String[] args = commandLine.getArgs();
      try {
        ParticipantId participantId = ParticipantId.of(modifiedBy);
        if (args.length == 2) {
          // If current password is empty, i.e. "", then user should pass
          // only the new password.
          args = Arrays.copyOf(args, 3);
          args[2] = args[1];
View Full Code Here

    String capabilitiesHash =
        OperationUtil.getRequiredParameter(operation, ParamsProperty.CAPABILITIES_HASH);

    RobotName robotName = RobotName.fromAddress(participant.getAddress());

    ParticipantId robotAccountId = ParticipantId.ofUnsafe(robotName.toEmailAddress());
    AccountData account;
    try {
      account = accountStore.getAccount(robotAccountId);
    } catch (PersistenceException e) {
      LOG.severe("Failed to retreive account data for " + robotAccountId, e);
View Full Code Here

   * Adds the given operation to the tail of the operation queue. Merges with
   * the delta at the tail if the creators match, otherwise creates a new tail
   * delta.
   */
  public void add(WaveletOperation op) {
    ParticipantId creator = op.getContext().getCreator();
    if (queue.isEmpty() || !creator.equals(tailCreator) ||
        (queue.getLast().state != ItemState.NONE)) {
      queue.addLast(new Item(new MergingSequence(), ItemState.NONE));
      tailCreator = creator;
    }
    queue.getLast().opSequence.add(op);
View Full Code Here

    if (newHead.isEmpty()) {
      return;
    }
    MergingSequence mergingHead = new MergingSequence(newHead);
    Item item = new Item(mergingHead, ItemState.SENT);
    ParticipantId creator = mergingHead.get(0).getContext().getCreator();
    if (queue.isEmpty()) {
      queue.add(item);
      tailCreator = creator;
    } else {
      queue.addFirst(item);
View Full Code Here

    if (item.state == ItemState.SENT) {
      return item;
    }

    MergingSequence resultDelta = item.opSequence;
    ParticipantId creator = resultDelta.get(0).getContext().getCreator();
    boolean needOptimisation = item.state != ItemState.OPTIMISED;

    while (!queue.isEmpty()) {
      Item nextItem = queue.element();
      MergingSequence nextDelta = nextItem.opSequence;
      ParticipantId nextCreator = nextDelta.get(0).getContext().getCreator();

      // don't merge sent ones due to non-commutativity of transformation
      // and composition
      if ((nextItem.state != ItemState.SENT) && creator.equals(nextCreator)) {
        resultDelta.addAll(nextDelta);
View Full Code Here

        String[] args = commandLine.getArgs();
        userId = args[1];
        String password = args[2];
        // Add domain to the user id if needed.
        userId = userId + (userId.contains("@") ? "" : "@" + getWaveDomain());
        ParticipantId participantId = ParticipantId.of(userId);
        createUser(accountStore, participantId, password);
        robotMessage = String.format("Created user %s, the password is: %s\n", userId, password);
        LOG.log(Level.INFO, "Created user " + userId + " by " + adminId);
      } catch (IllegalArgumentException e) {
        LOG.log(Level.SEVERE, userId, e);
View Full Code Here

TOP

Related Classes of org.waveprotocol.wave.model.wave.ParticipantId

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.