Examples of ParticipantId


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

        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

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

  protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    OAuthMessage message = new HttpRequestMessage(req, req.getRequestURL().toString());
    // OAuth %-escapes the @ in the username so we need to decode it.
    String username = OAuth.decodePercent(message.getConsumerKey());

    ParticipantId participant;
    try {
      participant = ParticipantId.of(username);
    } catch (InvalidParticipantAddress e) {
      LOG.info("Participant id invalid", e);
      resp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
      return;
    }

    AccountData account;
    try {
      account = accountStore.getAccount(participant);
    } catch (PersistenceException e) {
      LOG.severe("Failed to retrieve account data for " + participant, e);
      resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
          "An unexpected error occured while trying to retrieve account data for "
              + participant.getAddress());
      return;
    }
    if (account == null || !account.isRobot()) {
      LOG.info("The account for robot named " + participant + " does not exist");
      resp.setStatus(HttpServletResponse.SC_UNAUTHORIZED);
      return;
    }

    OAuthConsumer consumer =
        new OAuthConsumer(null, participant.getAddress(), account.asRobot().getConsumerSecret(),
            oauthServiceProvider);
    OAuthAccessor accessor = new OAuthAccessor(consumer);

    processOpsRequest(req, resp, message, accessor, participant);
  }
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.