Package org.waveprotocol.wave.model.wave

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


    for (String p : snapshot.getContributor()) {
      contributors.add(ParticipantId.of(p));
    }
    container.createDocument(
        snapshot.getDocumentId(),
        new ParticipantId(snapshot.getAuthor())// We trust the server's snapshot
        contributors,
        docInit,
        snapshot.getLastModifiedTime(),
        snapshot.getLastModifiedVersion());
  }
View Full Code Here


  /**
   * Creates HTTP response to the profile query. Main entrypoint for this class.
   */
  @Override
  protected void doGet(HttpServletRequest req, HttpServletResponse response) throws IOException {
    ParticipantId user = sessionManager.getLoggedInUser(req.getSession(false));
    if (user == null) {
      response.setStatus(HttpServletResponse.SC_FORBIDDEN);
      return;
    }
    ProfileRequest profileRequest = parseProfileRequest(req, response);
View Full Code Here

  }

  @Override
  protected void doGet(HttpServletRequest request, HttpServletResponse response)
      throws IOException {
    ParticipantId id = sessionManager.getLoggedInUser(request.getSession(false));

    // Eventually, it would be nice to show users who aren't logged in the public waves.
    // However, public waves aren't implemented yet. For now, we'll just redirect users
    // who haven't signed in to the sign in page.
    if (id == null) {
      response.sendRedirect(sessionManager.getLoginUrl("/"));
      return;
    }

    AccountData account = sessionManager.getLoggedInAccount(request.getSession(false));
    if (account != null) {
      String locale = account.asHuman().getLocale();
      if (locale != null) {
        String requestLocale = UrlParameters.getParameters(request.getQueryString()).get("locale");
        if (requestLocale == null) {
          response.sendRedirect(UrlParameters.addParameter(request.getRequestURL().toString(), "locale", locale));
          return;
        }
      }
    }

    String[] parts = id.getAddress().split("@");
    String username = parts[0];
    String userDomain = id.getDomain();

    try {
      WaveClientPage.write(response.getWriter(), new GxpContext(request.getLocale()),
          getSessionJson(request.getSession(false)), getClientFlags(request), websocketPresentedAddress,
          TopBar.getGxpClosure(username, userDomain), analyticsAccount);
View Full Code Here

    }
  }

  private JSONObject getSessionJson(HttpSession session) {
    try {
      ParticipantId user = sessionManager.getLoggedInUser(session);
      String address = (user != null) ? user.getAddress() : null;

      // TODO(zdwang): Figure out a proper session id rather than generating a
      // random number
      String sessionId = (new RandomBase64Generator()).next(10);
View Full Code Here

  private ClientIdGenerator() {
  }

  public static IdGeneratorImpl create() {
    return create(
        new ParticipantId(Session.get().getAddress()).getDomain(), Session.get().getIdSeed());
  }
View Full Code Here

      for (int i = 0; i < FAKE_DIGEST_COUNT; i++) {
        String title = randomSentence(r, 4);
        String snippet = randomSentence(r, 15);
        int msgs = Math.min(5, r.nextInt(20));
        int unread = Math.max(0, r.nextInt(msgs + 5) - 5);
        ParticipantId author = allParticipants.get(r.nextInt(allParticipants.size()));
        List<ParticipantId> participants = randomSubsequence(r, allParticipants);
        participants.remove(author);
        WaveId wid = WaveId.of(domain, "fake" + i);
        double lmt = now - r.nextDouble() * week;
        digests.add(new DigestSnapshot(title, snippet, wid, author, participants, lmt, unread, msgs));
View Full Code Here

      AtmosphereChannel resourceChannel =
          resourceSession.getAttribute(WAVE_CHANNEL_ATTRIBUTE, AtmosphereChannel.class);

      if (resourceChannel == null) {

        ParticipantId loggedInUser =
            provider.sessionManager.getLoggedInUser(resource.getRequest().getSession(false));

        AtmosphereConnection connection = new AtmosphereConnection(loggedInUser, provider);
        resourceChannel = connection.getAtmosphereChannel();
        resourceSession.setAttribute(WAVE_CHANNEL_ATTRIBUTE, resourceChannel);
View Full Code Here

  @Override
  protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    req.setCharacterEncoding("UTF-8");
    LoginContext context;
    Subject subject;
    ParticipantId loggedInAddress = null;

    if (isClientAuthEnabled) {
      boolean skipClientAuth = false;
      try {
        X509Certificate[] certs = (X509Certificate[]) req.getAttribute("javax.servlet.request.X509Certificate");
View Full Code Here

          String email = decodeEmailFromCertificate((byte[])rdn.getValue());
          if (email.endsWith("@" + clientAuthCertDomain)) {
            // Check we decoded the string correctly.
            Preconditions.checkState(WaveIdentifiers.isValidIdentifier(email),
                "The decoded email is not a valid wave identifier");
            ParticipantId id = ParticipantId.of(email);
            if (!RegistrationUtil.doesAccountExist(accountStore, id)) {
              if (!isRegistrationDisabled) {
                if (!RegistrationUtil.createAccountIfMissing(accountStore, id, null, welcomeBot)) {
                  return null;
                }
View Full Code Here

  protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
    // If the user is already logged in, we'll try to redirect them immediately.
    resp.setCharacterEncoding("UTF-8");
    req.setCharacterEncoding("UTF-8");
    HttpSession session = req.getSession(false);
    ParticipantId user = sessionManager.getLoggedInUser(session);

    if (user != null) {
      redirectLoggedInUser(req, resp);
    } else {
      if (isClientAuthEnabled && !failedClientAuth) {
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.