Package com.google.wave.api.event

Examples of com.google.wave.api.event.WaveletParticipantsChangedEvent


  public void testGenerateWaveletParticipantsChangedEventOnAdd() throws Exception {
    wavelet.addParticipant(BOB);
    EventMessageBundle messages = generateAndCheckEvents(EventType.WAVELET_PARTICIPANTS_CHANGED);
    assertTrue("Only expected one event", messages.getEvents().size() == 1);
    WaveletParticipantsChangedEvent event =
        WaveletParticipantsChangedEvent.as(messages.getEvents().get(0));
    assertTrue("Bob should be added", event.getParticipantsAdded().contains(BOB.getAddress()));
  }
View Full Code Here


  public void testGenerateWaveletParticipantsChangedEventOnRemove() throws Exception {
    wavelet.removeParticipant(ALEX);
    EventMessageBundle messages = generateAndCheckEvents(EventType.WAVELET_PARTICIPANTS_CHANGED);
    assertEquals("Expected one event", 1, messages.getEvents().size());
    WaveletParticipantsChangedEvent event =
      WaveletParticipantsChangedEvent.as(messages.getEvents().get(0));
    assertTrue(
        "Alex should be removed", event.getParticipantsRemoved().contains(ALEX.getAddress()));
  }
View Full Code Here

        // Add participant to conversation and send event.
        conversation.addParticipant(targetParticipant);
        participantsAdded.add(targetParticipant.getAddress());
        event =
            new WaveletParticipantsChangedEvent(null, null, participant.getAddress(),
                System.currentTimeMillis(), rootBlipId, participantsAdded, participantsRemoved);
        break;
      case WAVELET_REMOVE_PARTICIPANT_NEWSYNTAX:
        // Make sure targetParticipant is already member.
        if (!conversation.getParticipantIds().contains(targetParticipant)) {
          // Not a member, throw invalid request.
          String message = targetParticipant.getAddress() + " is not a " + "member of wavelet";
          LOG.info(message);
          throw new InvalidRequestException(message, operation);
        }

        // Remove participant and send event.
        conversation.removeParticipant(targetParticipant);
        participantsRemoved.add(targetParticipant.getAddress());

        event =
            new WaveletParticipantsChangedEvent(null, null, participant.getAddress(),
                System.currentTimeMillis(), rootBlipId, participantsAdded, participantsRemoved);
        break;
      default:
        throw new UnsupportedOperationException(
            "This OperationService does not implement operation of type " + type.method());
View Full Code Here

     */
    public void deltaEnd() {
      if (!participantsAdded.isEmpty() || !participantsRemoved.isEmpty()) {
        String rootBlipId = ConversationUtil.getRootBlipId(conversation);

        WaveletParticipantsChangedEvent event =
            new WaveletParticipantsChangedEvent(null, null, deltaAuthor.getAddress(),
                deltaTimestamp, rootBlipId, participantsAdded, participantsRemoved);
        addEvent(event, capabilities, rootBlipId, messages);
      }
      clearOncePerDeltaCollectors();

View Full Code Here

        // Add participant to conversation and send event.
        conversation.addParticipant(targetParticipant);
        participantsAdded.add(targetParticipant.getAddress());
        event =
            new WaveletParticipantsChangedEvent(null, null, participant.getAddress(),
                System.currentTimeMillis(), rootBlipId, participantsAdded, participantsRemoved);
        break;
      case WAVELET_REMOVE_PARTICIPANT_NEWSYNTAX:
        // Make sure targetParticipant is already member.
        if (!conversation.getParticipantIds().contains(targetParticipant)) {
          // Not a member, throw invalid request.
          String message = targetParticipant.getAddress() + " is not a " + "member of wavelet";
          LOG.info(message);
          throw new InvalidRequestException(message, operation);
        }

        // Remove participant and send event.
        conversation.removeParticipant(targetParticipant);
        participantsRemoved.add(targetParticipant.getAddress());

        event =
            new WaveletParticipantsChangedEvent(null, null, participant.getAddress(),
                System.currentTimeMillis(), rootBlipId, participantsAdded, participantsRemoved);
        break;
      default:
        throw new UnsupportedOperationException(
            "This OperationService does not implement operation of type " + type.method());
View Full Code Here

     */
    public void deltaEnd() {
      if (!participantsAdded.isEmpty() || !participantsRemoved.isEmpty()) {
        String rootBlipId = ConversationUtil.getRootBlipId(conversation);

        WaveletParticipantsChangedEvent event =
            new WaveletParticipantsChangedEvent(null, null, deltaAuthor.getAddress(),
                deltaTimestamp, rootBlipId, participantsAdded, participantsRemoved);
        addEvent(event, capabilities, rootBlipId, messages);
      }
      clearOncePerDeltaCollectors();

View Full Code Here

TOP

Related Classes of com.google.wave.api.event.WaveletParticipantsChangedEvent

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.