Package org.jclouds.ssh.jsch
Class JschSshClient
- java.lang.Object
-
- org.jclouds.ssh.jsch.JschSshClient
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceJschSshClient.Connection<T>static interfaceJschSshClient.ConnectionWithStreams<T>-
Nested classes/interfaces inherited from interface org.jclouds.ssh.SshClient
SshClient.Factory
-
-
Constructor Summary
Constructors Constructor Description JschSshClient(ProxyConfig proxyConfig, BackoffLimitedRetryHandler backoffLimitedRetryHandler, com.google.common.net.HostAndPort socket, LoginCredentials loginCredentials, int timeout, com.google.common.base.Optional<com.jcraft.jsch.agentproxy.Connector> agentConnector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T,C extends JschSshClient.Connection<T>>
Tacquire(C connection)voidconnect()voiddisconnect()ExecResponseexec(String command)Execute a process and block until it is completeExecChannelexecChannel(String command)Execute a process and allow the user to interact with it.protected JschSshClient.ConnectionWithStreams<com.jcraft.jsch.ChannelExec>execConnection(String command)Payloadget(String path)StringgetHostAddress()StringgetUsername()booleanisConnected()voidput(String path, String contents)voidput(String path, Payload contents)StringtoString()
-
-
-
Field Detail
-
logger
@Named("jclouds.ssh") protected Logger logger
-
-
Constructor Detail
-
JschSshClient
public JschSshClient(ProxyConfig proxyConfig, BackoffLimitedRetryHandler backoffLimitedRetryHandler, com.google.common.net.HostAndPort socket, LoginCredentials loginCredentials, int timeout, com.google.common.base.Optional<com.jcraft.jsch.agentproxy.Connector> agentConnector)
-
-
Method Detail
-
acquire
protected <T,C extends JschSshClient.Connection<T>> T acquire(C connection)
-
disconnect
@PreDestroy public void disconnect()
- Specified by:
disconnectin interfaceSshClient
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfaceSshClient
-
execConnection
protected JschSshClient.ConnectionWithStreams<com.jcraft.jsch.ChannelExec> execConnection(String command)
-
exec
public ExecResponse exec(String command)
Description copied from interface:SshClientExecute a process and block until it is complete
-
getHostAddress
public String getHostAddress()
- Specified by:
getHostAddressin interfaceSshClient
-
getUsername
public String getUsername()
- Specified by:
getUsernamein interfaceSshClient
-
execChannel
public ExecChannel execChannel(String command)
Description copied from interface:SshClientExecute a process and allow the user to interact with it.- Specified by:
execChannelin interfaceSshClient- Parameters:
command- command line to invoke- Returns:
- reference to the running process
-
-