Package org.waveprotocol.wave.model.wave

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


    websocket = new WaveWebSocketClient(websocketNotAvailable(), getWebSocketBaseUrl());
    websocket.connect();

    if (Session.get().isLoggedIn()) {
      loggedInUser = new ParticipantId(Session.get().getAddress());
      idGenerator = ClientIdGenerator.create();
      loginToServer();
    }

    setupUi();
View Full Code Here


   */
  @Timed
  @Override
  @VisibleForTesting
  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;
    }
    SearchRequest searchRequest = parseSearchRequest(req, response);
View Full Code Here

   * Create an http response to the fetch query. Main entrypoint for this class.
   */
  @Override
  @VisibleForTesting
  protected void doGet(HttpServletRequest req, HttpServletResponse response) throws IOException {
    ParticipantId user = sessionManager.getLoggedInUser(req.getSession(false));

    // This path will look like "/example.com/w+abc123/foo.com/conv+root
    // Strip off the leading '/'.
    String urlPath = req.getPathInfo().substring(1);

View Full Code Here

          token = token + "@" + localDomain;
        } else if (token.equals("@")) {
          // "@" is a shortcut for the shared domain participant.
          token = "@" + localDomain;
        }
        ParticipantId otherUser = ParticipantId.of(token);
        participants.add(otherUser);
      }
    } else {
      participants = Collections.emptyList();
    }
View Full Code Here

      }
    } else {
      waveletName = AttachmentUtil.waveRef2WaveletName(metadata.getWaveRef());
    }

    ParticipantId user = sessionManager.getLoggedInUser(request.getSession(false));
    boolean isAuthorized = false;
    try {
      isAuthorized = waveletProvider.checkAccessPermission(waveletName, user);
    } catch (WaveServerException e) {
      LOG.warning("Problem while authorizing user: " + user + " for wavelet: " + waveletName, e);
View Full Code Here

          response.sendError(HttpServletResponse.SC_BAD_REQUEST, "No wave reference in request.");
          return;
        }

        WaveletName waveletName = AttachmentUtil.waveRef2WaveletName(waveRefStr);
        ParticipantId user = sessionManager.getLoggedInUser(request.getSession(false));
        boolean isAuthorized = waveletProvider.checkAccessPermission(waveletName, user);
        if (!isAuthorized) {
          response.sendError(HttpServletResponse.SC_FORBIDDEN);
          return;
        }
View Full Code Here

        if (op instanceof AddParticipant) {
          if(LOG.isInfoLoggable()) {
            LOG.info("Update contains AddParticipant for " + ((AddParticipant)op).getParticipantId());
          }

          ParticipantId user = ((AddParticipant) op).getParticipantId();
          // Check first if we need to update views for this user.
          for (Listener listener : listeners) {
            listener.onParticipantAdded(waveletName, user);
          }
        } else if (op instanceof RemoveParticipant) {
          ParticipantId user = ((RemoveParticipant) op).getParticipantId();
          for (Listener listener : listeners) {
            listener.onParticipantRemoved(waveletName, user);
          }
        }
      }
View Full Code Here

  }

  @Override
  public AccountData getLoggedInAccount(HttpSession session) {
    // Consider caching the account data in the session object.
    ParticipantId user = getLoggedInUser(session);
    if (user != null) {
      try {
        return accountStore.getAccount(user);
      } catch (PersistenceException e) {
        LOG.warning("Failed to retrieve account data for " + user, e);
View Full Code Here

    protected abstract void sendMessage(int sequenceNo, Message message);

    private ParticipantId authenticate(String token) {
      HttpSession session = provider.sessionManager.getSessionFromToken(token);
      ParticipantId user = provider.sessionManager.getLoggedInUser(session);
      return user;
    }
View Full Code Here

        // (in which case loggedInUser must match the authenticated user, and
        // this message has no
        // effect).

        ProtocolAuthenticate authMessage = (ProtocolAuthenticate) message;
        ParticipantId authenticatedAs = authenticate(authMessage.getToken());

        Preconditions.checkArgument(authenticatedAs != null, "Auth token invalid");
        Preconditions.checkState(loggedInUser == null || loggedInUser.equals(authenticatedAs),
            "Session already authenticated as a different user");
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.