/** * Changes the comma-delimited list of local tunnels to establish * on the connection. * * @param tunnels a comma-delimited list of lport:rhost:rport * tunnel specifications */ public void setLocaltunnels(final String tunnels) { for (String tunnelSpec : tunnels.split(", ")) { if (!tunnelSpec.isEmpty()) { final String[] spec = tunnelSpec.split(":", 3); final int lport = Integer.parseInt(spec[0]); final String rhost = spec[1]; final int rport = Integer.parseInt(spec[2]); final LocalTunnel tunnel = createLocalTunnel(); tunnel.setLPort(lport); tunnel.setRHost(rhost); tunnel.setRPort(rport); } } }
/** * Changes the comma-delimited list of remote tunnels to establish * on the connection. * * @param tunnels a comma-delimited list of rport:lhost:lport * tunnel specifications */ public void setRemotetunnels(final String tunnels) { for (String tunnelSpec : tunnels.split(", ")) { if (!tunnelSpec.isEmpty()) { final String[] spec = tunnelSpec.split(":", 3); final int rport = Integer.parseInt(spec[0]); final String lhost = spec[1]; final int lport = Integer.parseInt(spec[2]); final RemoteTunnel tunnel = createRemoteTunnel(); tunnel.setRPort(rport); tunnel.setLHost(lhost); tunnel.setLPort(lport); } } }
if (getHost() == null) { throw new BuildException("Host is required."); if (getUserInfo().getName() == null) { throw new BuildException("Username is required."); if (getUserInfo().getKeyfile() == null && getUserInfo().getPassword() == null) { throw new BuildException("Password or Keyfile is required."); session = openSession(); session.setTimeout((int) maxwait); if (getFailonerror()) { throw new BuildException(TIMEOUT_MESSAGE, e); log(TIMEOUT_MESSAGE, Project.MSG_ERR); } else { if (getFailonerror()) { throw new BuildException(e); log("Caught exception: " + e.getMessage(), Project.MSG_ERR); if (getFailonerror()) { throw new BuildException(e); log("Caught exception: " + e.getMessage(), Project.MSG_ERR); } finally { if (session != null && session.isConnected()) {