Examples of IChatRoomContainer


Examples of org.eclipse.ecf.presence.chatroom.IChatRoomContainer

      } catch (FileNotFoundException e) {
      } catch (IOException e) {
      }
    }
    this.container = container;
    IChatRoomContainer chatRoomContainer = (IChatRoomContainer) container
        .getAdapter(IChatRoomContainer.class);
    chatMessageSender = chatRoomContainer.getPrivateMessageSender();
    chatRoomContainer.addMessageListener(new IIMMessageListener() {
      public void handleMessageEvent(IIMMessageEvent e) {
        if (e instanceof IChatMessageEvent) {
          IChatMessageEvent event = (IChatMessageEvent) e;
          String msg = event.getChatMessage().getBody();
          switch (msg.charAt(0)) {
View Full Code Here

Examples of org.eclipse.ecf.presence.chatroom.IChatRoomContainer

  public void testSendInvitation() throws Exception {
    final IChatRoomInvitationSender invitationSender = chat0.getInvitationSender();
    assertNotNull(invitationSender);
    final IChatRoomInfo roomInfo = chat0.getChatRoomInfo(CHAT_ROOM_NAME);
    if (roomInfo == null) return;
    final IChatRoomContainer chatRoomContainer = roomInfo.createChatRoomContainer();
    chatRoomContainer.connect(roomInfo.getRoomID(), null);
    invitationSender.sendInvitation(roomInfo.getRoomID(), getClient(1).getConnectedID(), null, "this is an invitation");
    try {
      synchronized (synchObject) {
        synchObject.wait(WAITTIME);
      }
View Full Code Here

Examples of org.eclipse.ecf.presence.chatroom.IChatRoomContainer

    synchronized (chatrooms) {
      toNotify = new ArrayList(chatrooms);
      chatrooms.clear();
    }
    for (final Iterator i = toNotify.iterator(); i.hasNext();) {
      final IChatRoomContainer cc = (IChatRoomContainer) i.next();
      cc.dispose();
    }
  }
View Full Code Here

Examples of org.eclipse.ecf.presence.chatroom.IChatRoomContainer

      List toNotify = null;
      synchronized (chatrooms) {
        toNotify = new ArrayList(chatrooms);
      }
      for (final Iterator i = toNotify.iterator(); i.hasNext();) {
        final IChatRoomContainer cont = (IChatRoomContainer) i.next();
        if (cont == null)
          continue;
        final ID tid = cont.getConnectedID();
        if (tid != null && tid instanceof XMPPRoomID) {
          final XMPPRoomID targetID = (XMPPRoomID) tid;
          final String tmuc = targetID.getMucString();
          if (tmuc.equals(mucname)) {
            return cont;
View Full Code Here

Examples of org.eclipse.ecf.presence.chatroom.IChatRoomContainer

    // Create client
    final XMPPChatRoomClient client = new XMPPChatRoomClient(this);
    // connect to senderAccount using senderPassword
    client.connect(senderAccount, originalArgs[1]);
    // get chat room
    final IChatRoomContainer chatRoomContainer = client.createChatRoom(originalArgs[2]);
    // join/connect to chat room
    chatRoomContainer.connect(client.getChatRoomInfo().getRoomID(), null);

    System.out.println("ECF chat room robot sender=" + senderAccount + "  Connected to room: " + client.getChatRoomInfo().getRoomID().getName());
    // Add message listener to chat room
    chatRoomContainer.addMessageListener(this);
    // Get chat room message sender
    sender = chatRoomContainer.getChatRoomMessageSender();
    sender.sendMessage("Hi, I'm a robot. To get rid of me, send me a direct message.");
    synchronized (lock) {
      while (!done) {
        lock.wait();
      }
View Full Code Here

Examples of org.eclipse.ecf.presence.chatroom.IChatRoomContainer

        final Object cm = deserializeContainerMessage((byte[]) obj);
        if (cm == null)
          throw new IOException(
              Messages.XMPPContainer_EXCEPTION_DESERIALIZED_OBJECT_NULL);
        final ContainerMessage contMessage = (ContainerMessage) cm;
        final IChatRoomContainer chat = chatRoomManager
            .findReceiverChatRoom(contMessage.getToContainerID());
        if (chat != null && chat instanceof XMPPChatRoomContainer) {
          final XMPPChatRoomContainer cont = (XMPPChatRoomContainer) chat;
          cont.handleContainerMessage(contMessage);
          return;
View Full Code Here

Examples of org.eclipse.ecf.presence.chatroom.IChatRoomContainer

    ID targetID = IDFactory.getDefault().createID(
        namespace,
        "irc://" + bot.getName() + "@" + bot.getServer());
    container.connect(targetID, null);
    IChatRoomInfo room = manager.getChatRoomInfo(bot.getChannel());
    IChatRoomContainer roomContainer = room.createChatRoomContainer();
    roomContainer.connect(room.getRoomID(), null);
    roomContainer.addMessageListener(this);
    sender = roomContainer.getChatRoomMessageSender();
  }
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.