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 interface
JschSshClient.Connection<T>
static interface
JschSshClient.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)
void
connect()
void
disconnect()
ExecResponse
exec(String command)
Execute a process and block until it is completeExecChannel
execChannel(String command)
Execute a process and allow the user to interact with it.protected JschSshClient.ConnectionWithStreams<com.jcraft.jsch.ChannelExec>
execConnection(String command)
Payload
get(String path)
String
getHostAddress()
String
getUsername()
boolean
isConnected()
void
put(String path, String contents)
void
put(String path, Payload contents)
String
toString()
-
-
-
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:
disconnect
in interfaceSshClient
-
isConnected
public boolean isConnected()
- Specified by:
isConnected
in interfaceSshClient
-
execConnection
protected JschSshClient.ConnectionWithStreams<com.jcraft.jsch.ChannelExec> execConnection(String command)
-
exec
public ExecResponse exec(String command)
Description copied from interface:SshClient
Execute a process and block until it is complete
-
getHostAddress
public String getHostAddress()
- Specified by:
getHostAddress
in interfaceSshClient
-
getUsername
public String getUsername()
- Specified by:
getUsername
in interfaceSshClient
-
execChannel
public ExecChannel execChannel(String command)
Description copied from interface:SshClient
Execute a process and allow the user to interact with it.- Specified by:
execChannel
in interfaceSshClient
- Parameters:
command
- command line to invoke- Returns:
- reference to the running process
-
-