Class SSHSession
- java.lang.Object
- 
- org.apache.tools.ant.ProjectComponent
- 
- org.apache.tools.ant.Task
- 
- org.apache.tools.ant.taskdefs.optional.ssh.SSHBase
- 
- org.apache.tools.ant.taskdefs.optional.ssh.SSHSession
 
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable,- LogListener
 
 public class SSHSession extends SSHBase Establishes an ssh session with a remote machine, optionally establishing port forwarding, then executes any nested task(s) before closing the session.- Since:
- Ant 1.8.0
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classSSHSession.LocalTunnelstatic classSSHSession.NestedSequentialThe class corresponding to the sequential nested element.classSSHSession.RemoteTunnel
 - 
Field Summary- 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description SSHSession()
 - 
Method SummaryModifier and Type Method Description voidaddTask(Task nestedTask)Add a nested task to Sequential.SSHSession.LocalTunnelcreateLocalTunnel()SSHSession.RemoteTunnelcreateRemoteTunnel()SSHSession.NestedSequentialcreateSequential()This is the sequential nested element of the macrodef.voidexecute()Establish the ssh session and execute all nestedTasksvoidsetLocaltunnels(java.lang.String tunnels)Changes the comma-delimited list of local tunnels to establish on the connection.voidsetRemotetunnels(java.lang.String tunnels)Changes the comma-delimited list of remote tunnels to establish on the connection.voidsetTimeout(long timeout)The connection can be dropped after a specified number of milliseconds.- 
Methods inherited from class org.apache.tools.ant.taskdefs.optional.ssh.SSHBasegetFailonerror, getHost, getPort, getServerAliveCountMax, getServerAliveIntervalSeconds, getUserInfo, getVerbose, init, openSession, setFailonerror, setHost, setKeyfile, setKnownhosts, setPassphrase, setPassword, setPort, setServerAliveCountMax, setServerAliveIntervalSeconds, setTrust, setUsername, setVerbose
 - 
Methods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 - 
Methods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 - 
Methods inherited from class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.tools.ant.taskdefs.optional.ssh.LogListenerlog
 
- 
 
- 
- 
- 
Method Detail- 
addTaskpublic void addTask(Task nestedTask) Add a nested task to Sequential.- Parameters:
- nestedTask- Nested task to execute sequentially
 
 - 
setTimeoutpublic void setTimeout(long timeout) The connection can be dropped after a specified number of milliseconds. This is sometimes useful when a connection may be flaky. Default is 0, which means "wait forever".- Parameters:
- timeout- The new timeout value in seconds
 
 - 
setLocaltunnelspublic void setLocaltunnels(java.lang.String tunnels) Changes the comma-delimited list of local tunnels to establish on the connection.- Parameters:
- tunnels- a comma-delimited list of lport:rhost:rport tunnel specifications
 
 - 
setRemotetunnelspublic void setRemotetunnels(java.lang.String tunnels) Changes the comma-delimited list of remote tunnels to establish on the connection.- Parameters:
- tunnels- a comma-delimited list of rport:lhost:lport tunnel specifications
 
 - 
executepublic void execute() throws BuildExceptionEstablish the ssh session and execute all nestedTasks- Overrides:
- executein class- Task
- Throws:
- BuildException- if one of the nested tasks fails, or network error or bad parameter.
 
 - 
createLocalTunnelpublic SSHSession.LocalTunnel createLocalTunnel() 
 - 
createRemoteTunnelpublic SSHSession.RemoteTunnel createRemoteTunnel() 
 - 
createSequentialpublic SSHSession.NestedSequential createSequential() This is the sequential nested element of the macrodef.- Returns:
- a sequential element to be configured.
 
 
- 
 
-