Package org.apache.sshd.common

Examples of org.apache.sshd.common.SshException


        if (!closeFuture.isDone()) {
            if (opened) {
                super.close(immediately);
            } else if (openFuture != null) {
                if (immediately) {
                    openFuture.setException(new SshException("Channel closed"));
                    super.close(immediately);
                } else {
                    openFuture.addListener(new SshFutureListener<OpenFuture>() {
                        public void operationComplete(OpenFuture future) {
                            if (future.isOpened()) {
View Full Code Here


        }
    }

    protected OpenFuture internalOpen() throws IOException {
        if (closeFuture.isClosed()) {
            throw new SshException("Session has been closed");
        }
        openFuture = new DefaultOpenFuture(lock);
        log.debug("Send SSH_MSG_CHANNEL_OPEN on channel {}", this);
        Buffer buffer = session.createBuffer(SshConstants.SSH_MSG_CHANNEL_OPEN);
        buffer.putString(type);
View Full Code Here

    public void handleOpenFailure(Buffer buffer) {
        int reason = buffer.getInt();
        String msg = buffer.getString();
        this.openFailureReason = reason;
        this.openFailureMsg = msg;
        this.openFuture.setException(new SshException(msg));
        this.closeFuture.setClosed();
        this.postClose();
        notifyStateChanged();
    }
View Full Code Here

    }

    public CloseFuture close(boolean immediately) {
        log.debug("Closing authentication service");
        if (!authFuture.isDone()) {
            authFuture.setException(new SshException("Session is closed"));
        }
        return CloseableUtils.closed();
    }
View Full Code Here

        }

        public synchronized OpenFuture open() throws IOException {
            InetSocketAddress remote = (InetSocketAddress) serverSession.getRemoteAddress();
            if (closeFuture.isClosed()) {
                throw new SshException("Session has been closed");
            }
            openFuture = new DefaultOpenFuture(lock);
            log.info("Send SSH_MSG_CHANNEL_OPEN on channel {}", id);
            Buffer buffer = session.createBuffer(SshConstants.SSH_MSG_CHANNEL_OPEN);
            buffer.putString(type);
View Full Code Here

    }

    public CloseFuture close(boolean immediately) {
        log.debug("Closing authentication service");
        if (!authFuture.isDone()) {
            authFuture.setException(new SshException("Session is closed"));
        }
        return CloseableUtils.closed();
    }
View Full Code Here

            if (!closeFuture.isDone()) {
                if (opened) {
                    super.close(immediately);
                } else if (openFuture != null) {
                    if (immediately) {
                        openFuture.setException(new SshException("Channel closed"));
                        super.close(immediately);
                    } else {
                        openFuture.addListener(new SshFutureListener<OpenFuture>() {
                            public void operationComplete(OpenFuture future) {
                                close(immediately);
View Full Code Here

        }
    }

    protected OpenFuture internalOpen() throws Exception {
        if (closeFuture.isClosed()) {
            throw new SshException("Session has been closed");
        }
        openFuture = new DefaultOpenFuture(lock);
        log.info("Send SSH_MSG_CHANNEL_OPEN on channel {}", id);
        Buffer buffer = session.createBuffer(SshConstants.Message.SSH_MSG_CHANNEL_OPEN, 0);
        buffer.putString(type);
View Full Code Here

        int reason = buffer.getInt();
        String msg = buffer.getString();
        synchronized (lock) {
            this.openFailureReason = reason;
            this.openFailureMsg = msg;
            this.openFuture.setException(new SshException(msg));
            this.closeFuture.setClosed();
            lock.notifyAll();
        }
    }
View Full Code Here

        buffer.putBoolean(true);
        buffer.putString(remote.getHostName());
        buffer.putInt(remote.getPort());
        Buffer result = session.request(buffer);
        if (result == null) {
            throw new SshException("Tcpip forwarding request denied by server");
        }
        int port = result.getInt();
        // TODO: Is it really safe to only store the local address after the request ?
        remoteToLocal.put(port, local);
        return new SshdSocketAddress(remote.getHostName(), port);
View Full Code Here

TOP

Related Classes of org.apache.sshd.common.SshException

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.