agave-systems/systems-core/src/main/java/org/iplantc/service/transfer/sftp/SftpRelay.java
/**
     * Create a proxy connection.
     * If connect fails then throw RemoteConnectionException
     *
     * @param sshClient
     * @param con
     * @param host
     * @param port
     * @param proxyHost - needed for capturing state in case of recoverable error
     * @param proxyPort - needed for capturing state in case of recoverable error
     * @param username
     * @param msgPrefix
     * @return
     * @throws RemoteConnectionException
     */
Create a proxy connection.
If connect fails then throw RemoteConnectionException


Create a proxy connection . If connect fails then throw RemoteConnectionException
private SshClient createProxyConnection(SshClient sshClient, SshConnector con,
                                            String host, int port, String proxyHost, int proxyPort,
                                            String username, String msgPrefix)
            throws RemoteConnectionException {
        Ssh2Client retClient;
        SshTunnel tunnel;
        try {
            tunnel = sshClient.openForwardingChannel(host, port, "127.0.0.1", 22, "127.0.0.1", 22, null, null);
        } catch (Exception e) {
            String msg = String.format("Failure open forwarding channel using proxy for %s : %s", msgPrefix, e.getMessage());
            throw new RemoteConnectionException(msg, e);
        }
        try {
            retClient = con.connect(tunnel, username);
        } catch (Exception e) {
            String msg = String.format("Failure to connect using proxy for %s : %s", msgPrefix, e.getMessage());
            throw new RemoteConnectionException(msg, e);
        }
        return retClient;
    }
private SshClient createProxyConnection ( SshClient sshClient , SshConnector con , String host , int port , String proxyHost , int proxyPort , String username , String msgPrefix ) throws RemoteConnectionException { Ssh2Client retClient ; SshTunnel tunnel ; try { tunnel = sshClient . openForwardingChannel ( host , port , "127.0.0.1" , 22 , "127.0.0.1" , 22 , null , null ) ; } catch ( Exception e ) { String msg = String . format ( "Failure open forwarding channel using proxy for %s : %s" , msgPrefix , e . getMessage ( ) ) ; throw new RemoteConnectionException ( msg , e ) ; } try { retClient = con . connect ( tunnel , username ) ; } catch ( Exception e ) { String msg = String . format ( "Failure to connect using proxy for %s : %s" , msgPrefix , e . getMessage ( ) ) ; throw new RemoteConnectionException ( msg , e ) ; } return retClient ; }
Create a proxy connection.
Create a proxy connection .
//            log.error(msg, e); // Connect using the tunnel //            log.error(msg, e);