Package org.waveprotocol.wave.model.wave

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


    sessionManager = new SessionManagerImpl(store, jettySessionManager);
  }

  public void testSessionFetchesAddress() {
    HttpSession session = mock(HttpSession.class);
    ParticipantId id = ParticipantId.ofUnsafe("tubes@example.com");
    when(session.getAttribute("user")).thenReturn(id);

    assertEquals(id, sessionManager.getLoggedInUser(session));
    assertSame(account, sessionManager.getLoggedInAccount(session));
  }
View Full Code Here


  @Override
  protected void setUp() throws Exception {
    super.setUp();

    ParticipantId viewer = new ParticipantId("nobody@nowhere.com");
    String adder = "evilbob@evil.com";
    IdGenerator idgen = FakeIdGenerator.create();
    view = BasicFactories.fakeWaveViewBuilder().with(idgen).build();
    userDataWavelet = view.createUserData();
    rootWavelet = view.createRoot();
View Full Code Here

   * Creates HTTP response to the search query. Main entrypoint for this class.
   */
  @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

    }
  }

  static private void deserializeAndUpdateProfile(RemoteProfileManagerImpl manager,
      FetchedProfile fetchedProfile) {
    ParticipantId participantId = ParticipantId.ofUnsafe(fetchedProfile.getAddress());
    ProfileImpl profile = manager.getProfile(participantId);
    // Profiles already exist for all profiles that have been requested.
    assert profile != null;
    // Updates profiles - this also notifies listeners.
    profile
View Full Code Here

  }

  @Override
  protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
      IOException {
    ParticipantId user = sessionManager.getLoggedInUser(req.getSession(false));
    String path = req.getRequestURI().replace("/waveref/", "");
    if (user != null) {
      resp.sendRedirect("/#" + path);
    } else {
      resp.sendRedirect("/auth/signin?r=/#" + path);
View Full Code Here

    } catch (UnsupportedCallbackException e) {
      throw new LoginException("Error: " + e.getCallback().toString());
    }

    boolean success;
    ParticipantId id = null;
   
    String address = nameCallback.getName();
    if (!address.contains(ParticipantId.DOMAIN_PREFIX)) {
      address = address + ParticipantId.DOMAIN_PREFIX + AccountStoreHolder.getDefaultDomain();
    }
View Full Code Here

    try {
      id = ModernIdSerialiser.INSTANCE.deserialiseWaveletId(snapshot.getWaveletId());
    } catch (InvalidIdException e) {
      throw new IllegalArgumentException(e);
    }
    ParticipantId creator = ParticipantId.ofUnsafe(snapshot.getParticipantId(0));
    HashedVersion version = deserialize(snapshot.getVersion());
    long lmt = snapshot.getLastModifiedTime();
    long ctime = snapshot.getCreationTime();
    long lmv = version.getVersion();

    WaveletDataImpl waveletData =
        new WaveletDataImpl(id, creator, ctime, lmv, version, lmt, waveId, docFactory);
    for (String participant : snapshot.getParticipantId()) {
      waveletData.addParticipant(new ParticipantId(participant));
    }
    for (DocumentSnapshot docSnapshot : snapshot.getDocument()) {
      deserialize(waveletData, docSnapshot);
    }
    return waveletData;
View Full Code Here

  private static void deserialize(WaveletDataImpl waveletData, DocumentSnapshot docSnapshot) {
    DocInitialization content =
        DocOpUtil.asInitialization(WaveletOperationSerializer.deserialize(docSnapshot
            .getDocumentOperation()));
    String docId = docSnapshot.getDocumentId();
    ParticipantId author = ParticipantId.ofUnsafe(docSnapshot.getAuthor());
    List<ParticipantId> contributors = Lists.newArrayList();
    for (String contributor : docSnapshot.getContributor()) {
      contributors.add(ParticipantId.ofUnsafe(contributor));
    }
    long lmt = docSnapshot.getLastModifiedTime();
View Full Code Here

  public static WaveletOperation deserialize(ProtocolWaveletOperation protobufOp,
      WaveletOperationContext ctx) {
    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

      DocumentFactory<?> docFactory) throws OperationException, InvalidParticipantAddress,
      InvalidIdException {
    ObservableWaveletData.Factory<? extends ObservableWaveletData> factory
        = WaveletDataImpl.Factory.create(docFactory);

    ParticipantId author = ParticipantId.of(snapshot.getCreator());
    WaveletId waveletId =
        ModernIdSerialiser.INSTANCE.deserialiseWaveletId(snapshot.getWaveletId());
    long creationTime = snapshot.getCreationTime();

    ObservableWaveletData wavelet = factory.create(new EmptyWaveletSnapshot(waveId, waveletId,
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.