Examples of XMPPRoomID


Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID

    return null;
  }

  protected ID createRoomIDFromName(String from) {
    try {
      return new XMPPRoomID(connectNamespace, ecfConnection.getXMPPConnection(), from);
    } catch (final URISyntaxException e) {
      return null;
    }
  }
View Full Code Here

Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID

    return new IChatRoomManager[0];
  }

  protected ID createIDFromHostedRoom(HostedRoom room) {
    try {
      return new XMPPRoomID(connectNamespace, ecfConnection.getXMPPConnection(), room.getJid(), room.getName());
    } catch (final URISyntaxException e) {
      // debug output
      return null;
    }
  }
View Full Code Here

Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID

  }

  public IChatRoomContainer findReceiverChatRoom(ID toID) {
    if (toID == null)
      return null;
    XMPPRoomID roomID = null;
    if (toID instanceof XMPPRoomID) {
      roomID = (XMPPRoomID) toID;
      final String mucname = roomID.getMucString();
      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.provider.xmpp.identity.XMPPRoomID

  }

  protected IChatRoomInfo getChatRoomInfo(ID roomID) {
    if (!(roomID instanceof XMPPRoomID))
      return null;
    final XMPPRoomID cRoomID = (XMPPRoomID) roomID;
    try {
      final RoomInfo info = MultiUserChat.getRoomInfo(ecfConnection.getXMPPConnection(), cRoomID.getMucString());
      if (info != null) {
        return new ECFRoomInfo(cRoomID, info, connectedID);
      }
    } catch (final XMPPException e) {
      return null;
View Full Code Here

Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID

    try {
      if (ecfConnection == null)
        return null;
      // Create roomid
      final XMPPConnection conn = ecfConnection.getXMPPConnection();
      final XMPPRoomID roomID = new XMPPRoomID(connectNamespace, conn, roomname);
      final String mucName = roomID.getMucString();
      final RoomInfo info = MultiUserChat.getRoomInfo(conn, mucName);
      if (info != null) {
        return new ECFRoomInfo(roomID, info, connectedID);
      }
    } catch (final Exception e) {
View Full Code Here

Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID

      }

      final RoomInfo info = MultiUserChat.getRoomInfo(ecfConnection.getXMPPConnection(), roomID);

      if (info != null) {
        final XMPPRoomID xid = new XMPPRoomID(connectedID.getNamespace(), ecfConnection.getXMPPConnection(), roomID, longname);
        return new ECFRoomInfo(xid, info, connectedID);
      } else
        throw new XMPPException(NLS.bind(Messages.XMPPChatRoomManager_EXCEPTION_NO_ROOM_INFO, roomID));
    } catch (final XMPPException e) {
      throw new ChatRoomCreateException(roomname, e.getMessage(), e);
View Full Code Here

Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID

                    Message message) {
                }
              });
          localChat.sendMessage(aMsg);
        } else if (receiver instanceof XMPPRoomID) {
          final XMPPRoomID roomID = (XMPPRoomID) receiver;
          aMsg.setType(Message.Type.groupchat);
          final String to = roomID.getMucString();
          aMsg.setTo(to);
          connection.sendPacket(aMsg);
        } else
          throw new IOException(
              "receiver must be of type XMPPID or XMPPRoomID");
View Full Code Here

Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID

  public void connect(ID remote, IConnectContext connectContext) throws ContainerConnectException {
    if (!(remote instanceof XMPPRoomID)) {
      throw new ContainerConnectException(NLS.bind(Messages.XMPPChatRoomContainer_Exception_Connect_Wrong_Type, remote));
    }
    final XMPPRoomID roomID = (XMPPRoomID) remote;
    fireContainerEvent(new ContainerConnectingEvent(this.getID(), remote, connectContext));
    synchronized (getConnectLock()) {
      try {
        connectionState = CONNECTING;
        remoteServerID = null;
        addSharedObjectToContainer(remote);
        multiuserchat = new MultiUserChat(getXMPPConnection(), roomID.getMucString());
        // Get nickname from join context
        String nick = null;
        try {
          final Callback[] callbacks = new Callback[1];
          callbacks[0] = new NameCallback(Messages.XMPPChatRoomContainer_NAME_CALLBACK_NICK, roomID.getNickname());
          if (connectContext != null) {
            final CallbackHandler handler = connectContext.getCallbackHandler();
            if (handler != null) {
              handler.handle(callbacks);
            }
          }
          if (callbacks[0] instanceof NameCallback) {
            final NameCallback cb = (NameCallback) callbacks[0];
            nick = cb.getName();
          }
        } catch (final Exception e) {
          throw new ContainerConnectException(Messages.XMPPChatRoomContainer_EXCEPTION_CALLBACKHANDLER, e);
        }
        String nickname = null;
        if (nick == null || nick.equals("")) //$NON-NLS-1$
          nickname = roomID.getNickname();
        else
          nickname = nick;
        multiuserchat.addSubjectUpdatedListener(new SubjectUpdatedListener() {
          public void subjectUpdated(String subject, String from) {
            fireSubjectUpdated(subject, from);
View Full Code Here

Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID

      return to;
  }

  protected ID createRoomIDFromName(String from) {
    try {
      return new XMPPRoomID(usernamespace, connection, from);
    } catch (final URISyntaxException e) {
      return null;
    }
  }
View Full Code Here

Examples of org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID

  }

  protected ID createRoomIDFromName(String from) {
    try {
      final ECFConnection ecfConnection = getConnectionOrThrowIfNull();
      return new XMPPRoomID(container.getConnectNamespace(),
          ecfConnection.getXMPPConnection(), from);
    } catch (final Exception e) {
      traceStack("Exception in createRoomIDFromName", e);
      return null;
    }
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.