Class SshSpawn
- java.lang.Object
-
- com.santaba.agent.groovyapi.expect.expectj.AbstractSpawnable
-
- com.santaba.agent.groovyapi.expect.expectj.SshSpawn
-
- All Implemented Interfaces:
Spawnable
public class SshSpawn extends AbstractSpawnable implements Spawnable
A Spawnable for controlling an SSH session using ExpectJ.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.santaba.agent.groovyapi.expect.expectj.Spawnable
Spawnable.CloseListener
-
-
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
-
SshSpawn
@Deprecated public SshSpawn(java.lang.String remoteHostName, int remotePort, java.lang.String username, java.lang.String password)
Deprecated.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
-
SshSpawn
public SshSpawn(com.jcraft.jsch.Channel channel) throws java.io.IOException
Takes control over an existing SSH channel.- Parameters:
channel
- The channel we should control. If this channel isn't already connected,Channel.connect()
will be called.- Throws:
java.io.IOException
- If connecting the channel fails.
-
-
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)
-
-