public class SshProvider extends Object
| Constructor and Description |
|---|
SshProvider()
Instantiates a new ssh provider.
|
SshProvider(SshMeta sshMeta,
String targetHost)
Instantiates a new ssh provider.
|
| Modifier and Type | Method and Description |
|---|---|
ResponseOnSingeRequest |
executeAndGenResponse(com.jcraft.jsch.ChannelExec channel)
Seems there are bad naming in the library the sysout is in
channel.getInputStream(); the syserr is in
((ChannelExec)channel).setErrStream(os);
|
ResponseOnSingeRequest |
executeSshCommand()
finally: will close the connection.
|
ResponseOnSingeRequest |
genErrorResponse(Exception t)
Gen error response.
|
SshMeta |
getSshMeta()
Gets the ssh meta.
|
String |
getTargetHost()
Gets the target host.
|
com.jcraft.jsch.Channel |
sessionConnectGenerateChannel(com.jcraft.jsch.Session session)
Session connect generate channel.
|
void |
setSshMeta(SshMeta sshMeta)
Sets the ssh meta.
|
void |
setTargetHost(String targetHost)
Sets the target host.
|
com.jcraft.jsch.Session |
startSshSessionAndObtainSession()
Start ssh session and obtain session.
|
public SshProvider(SshMeta sshMeta, String targetHost)
sshMeta - the ssh metatargetHost - the target hostpublic SshProvider()
public ResponseOnSingeRequest executeSshCommand()
public com.jcraft.jsch.Session startSshSessionAndObtainSession()
public com.jcraft.jsch.Channel sessionConnectGenerateChannel(com.jcraft.jsch.Session session)
throws com.jcraft.jsch.JSchException
session - the sessioncom.jcraft.jsch.JSchException - the j sch exceptionpublic ResponseOnSingeRequest executeAndGenResponse(com.jcraft.jsch.ChannelExec channel)
channel - the channelpublic ResponseOnSingeRequest genErrorResponse(Exception t)
t - the tpublic SshMeta getSshMeta()
public void setSshMeta(SshMeta sshMeta)
sshMeta - the new ssh metapublic String getTargetHost()
public void setTargetHost(String targetHost)
targetHost - the new target hostCopyright © 2015–2016 eBay. All rights reserved.