Package de.fu_berlin.inf.dpp

Examples of de.fu_berlin.inf.dpp.User


            // 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

            assert user.getJID().strictlyEquals(presenceJID);

            if (presence.isAvailable()) {
                if (user.getConnectionState() != UserConnectionState.ONLINE) {
                    user.setConnectionState(User.UserConnectionState.ONLINE);
                }
                user.setAway(presence.isAway());
            }

            if (!presence.isAvailable()
                && user.getConnectionState() != UserConnectionState.OFFLINE)
                user.setConnectionState(User.UserConnectionState.OFFLINE);
        }
View Full Code Here


        assert transmitter != null;
        assert sarosNet.getMyJID() != null;

        this.sessionStart = sessionStart;

        this.localUser = new User(this, sarosNet.getMyJID(), myColorID);

        this.prefStore = saros.getPreferenceStore();
        int updateInterval = prefStore
            .getInt(PreferenceConstants.MILLIS_UPDATE);
View Full Code Here

        DispatchThreadContext threadContext, JID hostID, int myColorID,
        DateTime sessionStart, SarosContext sarosContext) {

        this(transmitter, threadContext, myColorID, sessionStart, sarosContext);

        host = new User(this, hostID, 0);
        host.invitationCompleted();

        participants.put(hostID, host);
        participants.put(sarosNet.getMyJID(), localUser);
View Full Code Here

            throw new IllegalArgumentException(MessageFormat.format(
                Messages.SarosSession_jids_should_be_resource_qualified,
                Utils.prefix(jid)));
        }

        User user = participants.get(jid);

        if (user == null || !user.getJID().strictlyEquals(jid))
            return null;

        return user;
    }
View Full Code Here

    public JID getResourceQualifiedJID(JID jid) {

        if (jid == null)
            throw new IllegalArgumentException();

        User user = participants.get(jid);

        if (user == null)
            return null;

        return user.getJID();
    }
View Full Code Here

        }
    };

    protected void handleChangeColorActivity(ChangeColorActivity activity) {

        User user = activity.getSource();
        if (!user.isInSarosSession()) {
            throw new IllegalArgumentException(MessageFormat.format(
                Messages.ChangeColorManager_buddy_no_participant, user));
        }

        log.info("received color: " + activity.getColor() + " from buddy: " //$NON-NLS-1$ //$NON-NLS-2$
View Full Code Here

        }
    };

    protected void handleFileListActivity(ProjectsAddedActivity fileListActivity) {

        User user = fileListActivity.getSource();
        if (!user.isInSarosSession()) {
            throw new IllegalArgumentException(MessageFormat.format(
                Messages.ProjectsAddedManager_user_no_participant_of_session,
                user));
        }
        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,
View Full Code Here

     * @see de.fu_berlin.inf.dpp.IActivityProvider
     */
    public void exec(IActivity activity) {
        if (activity instanceof PermissionActivity) {
            PermissionActivity permissionActivity = (PermissionActivity) activity;
            User user = permissionActivity.getAffectedUser();
            if (!user.isInSarosSession()) {
                throw new IllegalArgumentException(MessageFormat.format(
                    Messages.PermissionManager_buddy_no_participant,
                    user));
            }
            Permission permission = permissionActivity.getPermission();
View Full Code Here

        if (sarosSession == null)
            throw new IllegalStateException(
                "Stop cannot be called without a shared project");

        // Creating StopActivity for asking user to stop
        User localUser = sarosSession.getLocalUser();
        final StopActivity stopActivity = new StopActivity(localUser,
            localUser, user, Type.LOCKREQUEST, State.INITIATED,
            new SimpleDateFormat("HHmmssSS").format(new Date())
                + random.nextLong());
View Full Code Here

        activityListeners.remove(listener);
    }

    public void fireActivity(StopActivity stopActivity) {

        User recipient = stopActivity.getRecipient();
        if (!recipient.isInSarosSession())
            throw new IllegalArgumentException("StopActivity contains"
                + " recipient which already left: " + stopActivity);

        sarosSession.sendActivity(recipient, stopActivity);
    }
View Full Code Here

TOP

Related Classes of de.fu_berlin.inf.dpp.User

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.