Examples of ISarosSession


Examples of de.fu_berlin.inf.dpp.project.ISarosSession

     * @param jid
     * @return
     */
    protected static UserElement getUserElement(Object inputElement, String jid) {
        if (inputElement instanceof RosterSessionInput) {
            ISarosSession sarosSession = ((RosterSessionInput) inputElement)
                .getSarosSession();
            if (sarosSession != null) {
                JID rqJID = sarosSession.getResourceQualifiedJID(new JID(jid));
                User user = sarosSession.getUser(rqJID);
                return getUserElement(inputElement, user);
            }
        }

        return null;
View Full Code Here

Examples of de.fu_berlin.inf.dpp.project.ISarosSession

                while (!done) {
                    RGB selectedColor = changeColor.open();
                    if (selectedColor == null) {
                        break;
                    }
                    ISarosSession sarosSession = sessionManager
                        .getSarosSession();
                    User localUser = sarosSession.getLocalUser();

                    Collection<User> listOfUsers = new Vector<User>();
                    listOfUsers.addAll(sarosSession.getParticipants());
                    listOfUsers.remove(localUser);

                    if (ChangeColorManager.checkColor(selectedColor,
                        listOfUsers)) {
                        log.info(selectedColor + " was selected."); //$NON-NLS-1$
                        SarosAnnotation.setUserColor(localUser, selectedColor);
                        for (User user : listOfUsers) {
                            sarosSession.sendActivity(user,
                                new ChangeColorActivity(localUser, user,
                                    selectedColor));
                        }
                        editorManager.colorChanged();
                        editorManager.refreshAnnotations();
View Full Code Here

Examples of de.fu_berlin.inf.dpp.project.ISarosSession

                    log.error("Received initiation packet more than once from "
                        + transferDescription.sender);
                    return;
                }

                ISarosSession sarosSession = sarosSessionObservable.getValue();
                if (sarosSession == null) {
                    log.warn("Not in a shared project, discarding packet!");
                    return;
                }

                final User from = sarosSession
                    .getUser(transferDescription.sender);
                if (from == null) {
                    log.warn("Buddy left, discarding packet!");
                    return;
                }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.project.ISarosSession

            return;
        }

        if (sessionManager != null) {
            // Is the chosen user currently in the session?
            ISarosSession sarosSession = sessionManager.getSarosSession();
            String entryJid = rosterEntry.getUser();

            if (sarosSession != null) {
                for (User p : sarosSession.getParticipants()) {
                    String pJid = p.getJID().getBase();

                    // If so, stop the deletion from completing
                    if (entryJid.equals(pJid)) {
                        MessageDialog.openError(null,
View Full Code Here

Examples of de.fu_berlin.inf.dpp.project.ISarosSession

     *
     * @client Can only be called on the client!
     */
    public void runRecovery(SubMonitor monitor) {

        ISarosSession session;
        synchronized (this) {
            // Keep a local copy, since the session might end while we're doing
            // this.
            session = sarosSession;
        }

        if (session.isHost())
            throw new IllegalStateException("Can only be called on the client");

        if (!lock.tryLock()) {
            log.error("Restarting Checksum Error Handling"
                + " while another operation is running");
            try {
                // Try to cancel currently running recovery
                do {
                    cancelRecovery.set(true);
                } while (!lock.tryLock(100, TimeUnit.MILLISECONDS));
            } catch (InterruptedException e) {
                log.error("Not designed to be interruptable");
                return;
            }
        }

        // Lock has been acquired
        try {
            cancelRecovery.set(false);

            final ArrayList<SPath> pathsOfHandledFiles = new ArrayList<SPath>(
                pathsWithWrongChecksums);

            for (SPath path : pathsOfHandledFiles) {

                if (cancelRecovery.get() || monitor.isCanceled())
                    return;

                // Save document before asking host to resend
                try {
                    editorManager.saveLazy(path);
                } catch (FileNotFoundException e) {
                    // Sending the checksum error message should recreate
                    // this file
                }
            }

            if (cancelRecovery.get())
                return;

            monitor.beginTask("Consistency recovery",
                pathsOfHandledFiles.size());
            final IProgressMonitor remoteProgress = remoteProgressManager
                .createRemoteProgress(session, session.getRemoteUsers());
            recoveryID = getNextRecoveryID();

            filesRemaining.set(pathsOfHandledFiles.size());

            remoteProgress.beginTask("Consistency recovery for buddy "
                + session.getLocalUser().getJID().getBase(),
                filesRemaining.get());

            session.sendActivity(session.getHost(), new ChecksumErrorActivity(
                session.getLocalUser(), pathsOfHandledFiles, recoveryID));

            try {
                // block until all inconsistencies are resolved
                int filesRemainingBefore = filesRemaining.get();
                int filesRemainingCurrently;
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.