Class SshSpawn2
- java.lang.Object
-
- com.santaba.agent.groovyapi.expect.expectj.AbstractSpawnable
-
- com.santaba.agent.groovyapi.expect.expectj.SshSpawn2
-
- All Implemented Interfaces:
Spawnable
public class SshSpawn2 extends AbstractSpawnable implements Spawnable
A Spawnable for controlling an SSH session using ExpectJ/SSHJ.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.santaba.agent.groovyapi.expect.expectj.Spawnable
Spawnable.CloseListener
-
-
Constructor Summary
Constructors Constructor Description SshSpawn2(java.lang.String remoteHostName, int remotePort, java.lang.String username, java.lang.String password)
Construct a new SSH spawn.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getExitValue()
Get exit valuejava.io.InputStream
getStderr()
Get the standard error input streamjava.io.OutputStream
getStdin()
Get the standard in output streamjava.io.InputStream
getStdout()
Get the standard out input streamboolean
isClosed()
Whether if ssh spawn closedvoid
start()
Start ssh spawnvoid
stop()
Stop the ssh spawn-
Methods inherited from class com.santaba.agent.groovyapi.expect.expectj.AbstractSpawnable
onClose, setCloseListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.santaba.agent.groovyapi.expect.expectj.Spawnable
setCloseListener
-
-
-
-
Constructor Detail
-
SshSpawn2
public SshSpawn2(java.lang.String remoteHostName, int remotePort, java.lang.String username, java.lang.String password)
Construct a new SSH spawn.- Parameters:
remoteHostName
- The remote host to connect to.remotePort
- The remote port to connect to.username
- The user name with which to authenticatepassword
- The password with which to authenticate
-
-
Method Detail
-
start
public void start() throws java.io.IOException
Start ssh spawn
-
getStdout
public java.io.InputStream getStdout()
Get the standard out input stream
-
getStdin
public java.io.OutputStream getStdin()
Get the standard in output stream
-
getStderr
public java.io.InputStream getStderr()
Get the standard error input stream
-
isClosed
public boolean isClosed()
Whether if ssh spawn closed
-
getExitValue
public int getExitValue()
Get exit value- Specified by:
getExitValue
in interfaceSpawnable
- Returns:
- Exit value
- See Also:
Spawnable.isClosed()
,System.exit(int)
-
-