Package de.fu_berlin.inf.dpp.net

Examples of de.fu_berlin.inf.dpp.net.JID


      if (msg.getTo() == null) {
        for (User u : sarosSession.getRemoteUsers()) {
          transmitter.sendToProjectUser(u.getJID(), extension);
        }
      } else {
        JID jid = new JID(msg.getTo());
        transmitter.sendToProjectUser(jid, extension);
      }
    } catch (Exception e) {
      log.error(
          prefix()
View Full Code Here


            ISarosSession sarosSession = sarosSessionObservable.getValue();

            if (sarosSession == null)
                return;

            JID presenceJID = new JID(presence.getFrom());

            // The presenceJID can be bare if the roster entry has gone off-line
            if (presenceJID.isBareJID()) {
                // Check if there is a user in this project using the user name
                // part of the JID
                presenceJID = sarosSession.getResourceQualifiedJID(presenceJID);

                // No such user in the project
                if (presenceJID == null)
                    return;
            }

            // By now we should have returned or have a RQ-JID
            assert presenceJID.isResourceQualifiedJID();

            // Get the user (if any)
            User user = sarosSession.getUser(presenceJID);
            if (user == null)
                return; // PresenceJID does not identify a user in the project
View Full Code Here

     * @return
     */
    public JID getJID() {
        if (this.connection == null)
            return null;
        return new JID(this.connection.getUser());
    }
View Full Code Here

     * Returns the {@link ChatState} of all participants but oneself.
     *
     * @return
     */
    public List<ChatState> getForeignStates() {
        JID self = this.getJID();
        List<ChatState> foreignStates = new ArrayList<ChatState>();
        for (JID jid : this.participants.keySet()) {
            if (jid.equals(self))
                continue;
            foreignStates.add(this.participants.get(jid));
View Full Code Here

    public void addUser(User user) {

        assert user.getSarosSession().equals(this);

        JID jid = user.getJID();

        if (participants.putIfAbsent(jid, user) != null) {
            log.error("Buddy " + Utils.prefix(jid) //$NON-NLS-1$
                + " added twice to SarosSession", new StackTrace()); //$NON-NLS-1$
            throw new IllegalArgumentException();
View Full Code Here

        log.info("Buddy " + Utils.prefix(jid) + " joined session."); //$NON-NLS-1$ //$NON-NLS-2$
    }

    public void removeUser(User user) {
        JID jid = user.getJID();
        if (participants.remove(jid) == null) {
            log.warn("Tried to remove buddy who was not in participants:"
                + Utils.prefix(jid));
            return;
        }
View Full Code Here

        if (!user.hasWriteAccess()) {
            log.warn(Utils.prefix(user.getJID())
                + " send FileListActivity, but has no writing permission in session"); //$NON-NLS-1$
            return;
        }
        JID from = fileListActivity.getSource().getJID();
        sessionManager.incomingProjectReceived(from, sarosUI,
            fileListActivity.getProjectInfos(),
            fileListActivity.getProcessID(), fileListActivity.doStream());
    }
View Full Code Here

     */
    protected XMPPAccount addXMPPAccount() {
        if (enterXMPPAccountWizardPage.isXMPPAccountCreated())
            return null;

        JID jid = enterXMPPAccountWizardPage.getJID();
        String password = enterXMPPAccountWizardPage.getPassword();

        String server = enterXMPPAccountWizardPage.getServer();
        String username;
        if (server.isEmpty()) {
            // If no optional server, use server portion of jid
            server = jid.getDomain();
            username = jid.getName();
        } else {
            // If optional server, use whole jid for username
            username = jid.getBase();
        }

        boolean hasActiveAccount = accountStore.hasActiveAccount();

        XMPPAccount account = accountStore.createNewAccount(username, password,
View Full Code Here

                    if (payload == null) {
                        log.warn("Invalid ActivitiesExtensionPacket"
                            + " does not contain a payload: " + packet);
                        return;
                    }
                    JID from = new JID(packet.getFrom());
                    List<TimedActivityDataObject> timedActivities = payload
                        .getTimedActivities();

                    if (!ObjectUtils.equals(sessionID.getValue(),
                        payload.getSessionID())) {
View Full Code Here

        throws LocalCancellationException {

        log.debug("Inv" + Utils.prefix(peer) + ": Checking Saros support...");
        subMonitor.setTaskName("Checking Saros support...");

        JID rqPeer = discoveryManager.getSupportingPresence(peer,
            Saros.NAMESPACE);

        if (rqPeer == null) {
            log.debug("Inv" + Utils.prefix(peer)
                + ": Saros is not supported or User is offline.");

            if (!discoveryManager.isOnline(peer)) {
                InvitationWizard.notifyUserOffline(peer);
                localCancel(null, CancelOption.DO_NOT_NOTIFY_PEER);
                throw new LocalCancellationException();
            } else if (!InvitationWizard.confirmUnsupportedSaros(peer)) {
                localCancel(null, CancelOption.DO_NOT_NOTIFY_PEER);
                throw new LocalCancellationException();
            }
            /**
             * In order to avoid inviting other XMPP clients, we construct an
             * RQ-JID.
             */
            rqPeer = new JID(peer.getBareJID() + "/" + Saros.RESOURCE);
            peerAdvertisesSarosSupport = false;
        } else {
            log.debug("Inv" + Utils.prefix(peer) + ": Saros is supported.");
        }
        peer = rqPeer;
View Full Code Here

TOP

Related Classes of de.fu_berlin.inf.dpp.net.JID

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.