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:
- Cloneable,- LogListener
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 ClassesModifier and TypeClassDescriptionclassstatic classThe class corresponding to the sequential nested element.class
- 
Field SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdd a nested task to Sequential.This is the sequential nested element of the macrodef.voidexecute()Establish the ssh session and execute all nestedTasksvoidsetLocaltunnels(String tunnels) Changes the comma-delimited list of local tunnels to establish on the connection.voidsetRemotetunnels(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.SSHBaseaddConfiguredAdditionalConfig, getFailonerror, getHost, getPort, getServerAliveCountMax, getServerAliveIntervalSeconds, getSshConfig, getUserInfo, getVerbose, init, loadSshConfig, openSession, setFailonerror, setHost, setKeyfile, setKnownhosts, setPassphrase, setPassword, setPort, setServerAliveCountMax, setServerAliveIntervalSeconds, setSshConfig, setTrust, setUsername, setVerboseMethods 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, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProjectMethods inherited from class java.lang.Objectequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.tools.ant.taskdefs.optional.ssh.LogListenerlog
- 
Constructor Details- 
SSHSessionpublic SSHSession()
 
- 
- 
Method Details- 
addTaskAdd 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
 
- 
setLocaltunnelsChanges the comma-delimited list of local tunnels to establish on the connection.- Parameters:
- tunnels- a comma-delimited list of lport:rhost:rport tunnel specifications
 
- 
setRemotetunnelsChanges the comma-delimited list of remote tunnels to establish on the connection.- Parameters:
- tunnels- a comma-delimited list of rport:lhost:lport tunnel specifications
 
- 
executeEstablish 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.
 
- 
createLocalTunnel
- 
createRemoteTunnel
- 
createSequentialThis is the sequential nested element of the macrodef.- Returns:
- a sequential element to be configured.
 
 
-