Examples of LocalCancellationException


Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

        subMonitor.setWorkRemaining(100);
        List<ProjectExchangeInfo> pInfos = new ArrayList<ProjectExchangeInfo>(
            projectsToShare.size());
        for (IProject iProject : projectsToShare) {
            if (subMonitor.isCanceled())
                throw new LocalCancellationException(null,
                    CancelOption.DO_NOT_NOTIFY_PEER);
            try {
                String projectID = this.getSarosSession()
                    .getProjectID(iProject);
                String projectName = iProject.getName();
                FileList projectFileList = FileListFactory.createFileList(
                    iProject,
                    this.getSarosSession().getSharedResources(iProject), this
                        .getSarosSession().useVersionControl(), subMonitor
                        .newChild(0));
                projectFileList.setProjectID(projectID);
                boolean partial = !this.getSarosSession().isCompletelyShared(
                    iProject);

                ProjectExchangeInfo pInfo = new ProjectExchangeInfo(projectID,
                    "", projectName, partial, projectFileList); //$NON-NLS-1$
                pInfos.add(pInfo);
            } catch (CoreException e) {
                throw new LocalCancellationException(e.getMessage(),
                    CancelOption.DO_NOT_NOTIFY_PEER);
            }
            subMonitor.worked(100 / projectsToShare.size());
        }
        subMonitor.subTask(""); //$NON-NLS-1$
View Full Code Here

Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

                        throw new RuntimeException(e.getMessage());
                    }
                }
            });
        } catch (Exception e) {
            throw new LocalCancellationException(e.getMessage(),
                CancelOption.NOTIFY_PEER);
        }
        return newLocalProject;
    }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

                "executeCancellation should only be called after localCancel or remoteCancel!");

        String errorMsg;
        String cancelMessage;
        if (cancellationCause instanceof LocalCancellationException) {
            LocalCancellationException e = (LocalCancellationException) cancellationCause;
            errorMsg = e.getMessage();

            switch (e.getCancelOption()) {
            case NOTIFY_PEER:
                transmitter.sendCancelSharingProjectMessage(peer, errorMsg);
                break;
            case DO_NOT_NOTIFY_PEER:
                break;
            default:
                log.warn("Inv" + Utils.prefix(peer)
                    + ": This case is not expected here.");
            }

            if (errorMsg != null) {
                cancelMessage = "Sharing project was cancelled locally"
                    + " because of an error: " + errorMsg;
                log.error("Inv" + Utils.prefix(peer) + ": " + cancelMessage);
            } else {
                cancelMessage = "Sharing project was cancelled by local user.";
                log.debug("Inv" + Utils.prefix(peer) + ": " + cancelMessage);
            }

        } else if (cancellationCause instanceof RemoteCancellationException) {
            RemoteCancellationException e = (RemoteCancellationException) cancellationCause;
            errorMsg = e.getMessage();
            if (errorMsg != null) {
                cancelMessage = MessageFormat
                    .format(
                        "Sharing project was cancelled by the remote user because of an error on his/her side: {0}",
                        errorMsg);
View Full Code Here

Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

        if (!cancelled.compareAndSet(false, true))
            return;
        log.debug("Inv" + Utils.prefix(peer) + ": localCancel: " + errorMsg);
        if (monitor != null)
            monitor.setCanceled(true);
        cancellationCause = new LocalCancellationException(errorMsg,
            cancelOption);
        if (monitor == null) {
            log.debug("Inv" + Utils.prefix(peer)
                + ": Closing JoinSessionWizard manually.");
            try {
View Full Code Here

Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

            diff = diff.addAllFolders(currentLocalProject,
                monitor.newChild(40, SubMonitor.SUPPRESS_ALL_LABELS));

            return diff;
        } catch (CoreException e) {
            throw new LocalCancellationException(MessageFormat.format(
                "Could not create diff file list: {0}", e.getMessage()),
                CancelOption.NOTIFY_PEER);
        } finally {
            monitor.done();
        }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

            try {
                throw e.getCause();
            } catch (LocalCancellationException lc) {
                throw lc;
            } catch (Throwable t) {
                throw new LocalCancellationException(
                    "An error occurred while writing the archive: "
                        + t.getMessage(), CancelOption.NOTIFY_PEER);
            }
        }
    }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

                "executeCancellation should only be called after localCancel or remoteCancel!");

        String errorMsg;
        String cancelMessage;
        if (cancellationCause instanceof LocalCancellationException) {
            LocalCancellationException e = (LocalCancellationException) cancellationCause;
            errorMsg = e.getMessage();

            switch (e.getCancelOption()) {
            case NOTIFY_PEER:
                transmitter.sendCancelInvitationMessage(peer, errorMsg);
                break;
            case DO_NOT_NOTIFY_PEER:
                break;
            default:
                log.warn("Inv" + Utils.prefix(peer)
                    + ": This case is not expected here.");
            }

            if (errorMsg != null) {
                cancelMessage = "Invitation was cancelled locally"
                    + " because of an error: " + errorMsg;
                log.error("Inv" + Utils.prefix(peer) + ": " + cancelMessage);
                monitor.setTaskName("Invitation failed. (" + errorMsg + ")");
            } else {
                cancelMessage = "Invitation was cancelled by local user.";
                log.debug("Inv" + Utils.prefix(peer) + ": " + cancelMessage);
                monitor.setTaskName("Invitation has been cancelled.");
            }

        } else if (cancellationCause instanceof RemoteCancellationException) {
            RemoteCancellationException e = (RemoteCancellationException) cancellationCause;

            errorMsg = e.getMessage();
            if (errorMsg != null) {
                cancelMessage = "Invitation was cancelled by the remote user "
                    + " because of an error on his/her side: " + errorMsg;
                log.error("Inv" + Utils.prefix(peer) + ": " + cancelMessage);
                monitor.setTaskName("Invitation failed.");
View Full Code Here

Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

            subMonitor.setWorkRemaining(100);
            useVersionControl = sarosSession.useVersionControl();
            pInfos = new ArrayList<ProjectExchangeInfo>(this.projects.size());
            for (IProject iProject : this.projects) {
                if (subMonitor.isCanceled())
                    throw new LocalCancellationException(null,
                        CancelOption.NOTIFY_PEER);
                try {
                    String projectID = sarosSession.getProjectID(iProject);
                    String projectName = iProject.getName();
                    FileList projectFileList = FileListFactory.createFileList(
                        iProject, this.selectedProjectResources.get(iProject),
                        useVersionControl, subMonitor.newChild(0));
                    projectFileList.setProjectID(projectID);
                    boolean partial = !sarosSession
                        .isCompletelyShared(iProject);

                    ProjectExchangeInfo pInfo = new ProjectExchangeInfo(
                        projectID, "", projectName, partial, projectFileList);
                    pInfos.add(pInfo);
                } catch (CoreException e) {
                    throw new LocalCancellationException(e.getMessage(),
                        CancelOption.NOTIFY_PEER);
                }
                subMonitor.worked(100 / projects.size());
            }
        }
        if (subMonitor.isCanceled())
            throw new LocalCancellationException(null, CancelOption.NOTIFY_PEER);
        subMonitor.subTask("");
        log.debug("Inv" + Utils.prefix(peer) + ": Sending file list...");
        subMonitor.setTaskName("Sending file list...");
        this.sarosSession.sendActivity(sarosSession.getUser(peer),
            new ProjectsAddedActivity(sarosSession.getLocalUser(), pInfos,
View Full Code Here

Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

        if (!cancelled.compareAndSet(false, true))
            return;
        log.debug("Inv" + Utils.prefix(peer) + ": localCancel: " + errorMsg);
        if (monitor != null)
            monitor.setCanceled(true);
        cancellationCause = new LocalCancellationException(errorMsg,
            cancelOption);
    }
View Full Code Here

Examples of de.fu_berlin.inf.dpp.exceptions.LocalCancellationException

                "executeCancellation should only be called after localCancel or remoteCancel!");

        String errorMsg;
        String cancelMessage;
        if (cancellationCause instanceof LocalCancellationException) {
            LocalCancellationException e = (LocalCancellationException) cancellationCause;
            errorMsg = e.getMessage();

            switch (e.getCancelOption()) {
            case NOTIFY_PEER:
                transmitter.sendCancelInvitationMessage(peer, errorMsg);
                break;
            case DO_NOT_NOTIFY_PEER:
                break;
            default:
                log.warn("Inv" + Utils.prefix(peer)
                    + ": This case is not expected here.");
            }

            if (errorMsg != null) {
                cancelMessage = "Invitation was cancelled locally"
                    + " because of an error: " + errorMsg;
                log.error("Inv" + Utils.prefix(peer) + ": " + cancelMessage);
                monitor.setTaskName("Invitation failed. (" + errorMsg + ")");
            } else {
                cancelMessage = "Invitation was cancelled by local user.";
                log.debug("Inv" + Utils.prefix(peer) + ": " + cancelMessage);
                monitor.setTaskName("Invitation has been cancelled.");
            }

        } else if (cancellationCause instanceof RemoteCancellationException) {
            RemoteCancellationException e = (RemoteCancellationException) cancellationCause;

            errorMsg = e.getMessage();
            if (errorMsg != null) {
                cancelMessage = "Invitation was cancelled by the remote user "
                    + " because of an error on his/her side: " + errorMsg;
                log.error("Inv" + Utils.prefix(peer) + ": " + cancelMessage);
                monitor.setTaskName("Invitation failed.");
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.