Examples of ForwardingConfigurationException


Examples of com.sshtools.j2ssh.forwarding.ForwardingConfigurationException

            config.start();
            localForwardings.add(config);

            return config;
        } catch (IOException ex) {
            throw new ForwardingConfigurationException(ex.getMessage());
        }
    }
View Full Code Here

Examples of com.sshtools.j2ssh.forwarding.ForwardingConfigurationException

                    (config.getPortToBind() == portToBind)) {
                return config;
            }
        }

        throw new ForwardingConfigurationException(
            "The remote forwarding does not exist!");
    }
View Full Code Here

Examples of com.sshtools.j2ssh.forwarding.ForwardingConfigurationException

        while (it.hasNext()) {
            config = (ForwardingConfiguration) it.next();

            if (config.getAddressToBind().equals(addressToBind) &&
                    (config.getPortToBind() == portToBind)) {
                throw new ForwardingConfigurationException(
                    "The address and port are already in use!");
            }
        }

        config = new ForwardingConfiguration(addressToBind, portToBind);

        // Check the security mananger
        SecurityManager manager = System.getSecurityManager();

        if (manager != null) {
            try {
                manager.checkPermission(new SocketPermission(addressToBind +
                        ":" + String.valueOf(portToBind), "accept,listen"));
            } catch (SecurityException e) {
                throw new ForwardingConfigurationException(
                    "The security manager has denied listen permision on " +
                    addressToBind + ":" + String.valueOf(portToBind));
            }
        }

        try {
            ForwardingListener listener = new ServerForwardingListener(connection,
                    addressToBind, portToBind);
            remoteForwardings.add(listener);
            listener.start();
        } catch (IOException ex) {
            throw new ForwardingConfigurationException(ex.getMessage());
        }
    }
View Full Code Here

Examples of com.sshtools.j2ssh.forwarding.ForwardingConfigurationException

                    socket.getInetAddress().getHostAddress(), socket.getPort());
                channel.bindSocket(socket);

                return channel;
            } catch (IOException ex) {
                throw new ForwardingConfigurationException(ex.getMessage());
            }
        }
View Full Code Here

Examples of com.sshtools.j2ssh.forwarding.ForwardingConfigurationException

            config.start();
            localForwardings.add(config);

            return config;
        } catch (IOException ex) {
            throw new ForwardingConfigurationException(ex.getMessage());
        }
    }
View Full Code Here

Examples of com.sshtools.j2ssh.forwarding.ForwardingConfigurationException

                    (config.getPortToBind() == portToBind)) {
                return config;
            }
        }

        throw new ForwardingConfigurationException(
            "The remote forwarding does not exist!");
    }
View Full Code Here

Examples of com.sshtools.j2ssh.forwarding.ForwardingConfigurationException

        while (it.hasNext()) {
            config = (ForwardingConfiguration) it.next();

            if (config.getAddressToBind().equals(addressToBind) &&
                    (config.getPortToBind() == portToBind)) {
                throw new ForwardingConfigurationException(
                    "The address and port are already in use!");
            }
        }

        config = new ForwardingConfiguration(addressToBind, portToBind);

        // Check the security mananger
        SecurityManager manager = System.getSecurityManager();

        if (manager != null) {
            try {
                manager.checkPermission(new SocketPermission(addressToBind +
                        ":" + String.valueOf(portToBind), "accept,listen"));
            } catch (SecurityException e) {
                throw new ForwardingConfigurationException(
                    "The security manager has denied listen permision on " +
                    addressToBind + ":" + String.valueOf(portToBind));
            }
        }

        try {
            ForwardingListener listener = new ServerForwardingListener(connection,
                    addressToBind, portToBind);
            remoteForwardings.add(listener);
            listener.start();
        } catch (IOException ex) {
            throw new ForwardingConfigurationException(ex.getMessage());
        }
    }
View Full Code Here

Examples of com.sshtools.j2ssh.forwarding.ForwardingConfigurationException

                    socket.getInetAddress().getHostAddress(), socket.getPort());
                channel.bindSocket(socket);

                return channel;
            } catch (IOException ex) {
                throw new ForwardingConfigurationException(ex.getMessage());
            }
        }
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.