Examples of LocalCancellationException


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

                "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);
            } else {
                cancelMessage = "Invitation 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 = "Invitation was cancelled by the remote user "
                    + " because of an error on his/her side: " + errorMsg;
                log.error("Inv" + Utils.prefix(peer) + ": " + cancelMessage);
            } else {
View Full Code Here

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

                + ": 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.
             */
 
View Full Code Here

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

                if (InvitationWizard.confirmVersionConflict(versionInfo, peer,
                    versionManager.getVersion()))
                    this.versionInfo = versionInfo;
                else {
                    localCancel(null, CancelOption.DO_NOT_NOTIFY_PEER);
                    throw new LocalCancellationException();
                }
            }
        } else {
            log.debug("Inv" + Utils.prefix(peer)
                + ": Unable to obtain peer's version information.");
View Full Code Here

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

        subMonitor
            .setTaskName("Invitation sent. Waiting for acknowledgement...");

        if (!transmitter.receivedInvitationAcknowledgment(invitationID,
            subMonitor.newChild(1, SubMonitor.SUPPRESS_ALL_LABELS))) {
            throw new LocalCancellationException(
                peerAdvertisesSarosSupport ? "No invitation acknowledgement received."
                    : "Missing Saros support.", CancelOption.DO_NOT_NOTIFY_PEER);
        }

        subMonitor.worked(2);
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

        try {
            ZipEntry entry;
            while ((entry = zip.getNextEntry()) != null) {

                if (monitor.isCanceled())
                    throw new LocalCancellationException();

                IPath path = Path.fromPortableString(entry.getName());
                IFile file = container.getFile(path);

                writeFile(new FilterInputStream(zip) {
View Full Code Here

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

        try {
            while (true) {

                if (progress.isCanceled())
                    throw new LocalCancellationException();

                if (inputStream == null)
                    throw new IOException("Socket already disposed");

                BinaryPacket packet = BinaryPacket
                    .parseDelimitedFrom(inputStream);
                if (packet == null) {
                    if (progress.isCanceled())
                        throw new LocalCancellationException();
                    throw new EOFException("No more packets");
                }

                final int objectid = packet.getObjectid();
View Full Code Here

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

                         */

            if (progress.isCanceled()) {
                log.info("Sending " + objectid
                    + " was cancelled by the local user");
                throw new LocalCancellationException();
            }

            size = Math.min(data.length - offset, CHUNKSIZE);
            send(buildPacket(type, idx - 1, objectid,
                ByteString.copyFrom(data, offset, size)));
View Full Code Here

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

        IncomingTransferObject result = incomingExtProv.getPayload(receive(
            monitor, collector, 500, true));

        if (monitor.isCanceled()) {
            result.reject();
            throw new LocalCancellationException();
        }

        byte[] data = result.accept(monitor);
        String fileListAsString;
        try {
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.