Package org.jclouds.sshj
Class SshjSshClient
- java.lang.Object
-
- org.jclouds.sshj.SshjSshClient
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SshjSshClient.Connection<T>
-
Nested classes/interfaces inherited from interface org.jclouds.ssh.SshClient
SshClient.Factory
-
-
Constructor Summary
Constructors Constructor Description SshjSshClient(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 SshjSshClient.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 SshjSshClient.Connection<net.schmizz.sshj.connection.channel.direct.Session>
execConnection()
Payload
get(String path)
String
getHostAddress()
String
getUsername()
boolean
isConnected()
protected SshjSshClient.Connection<net.schmizz.sshj.connection.channel.direct.Session>
noPTYConnection()
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
-
SshjSshClient
public SshjSshClient(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 SshjSshClient.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 SshjSshClient.Connection<net.schmizz.sshj.connection.channel.direct.Session> execConnection()
-
exec
public ExecResponse exec(String command)
Description copied from interface:SshClient
Execute a process and block until it is complete
-
noPTYConnection
protected SshjSshClient.Connection<net.schmizz.sshj.connection.channel.direct.Session> noPTYConnection()
-
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
-
getHostAddress
public String getHostAddress()
- Specified by:
getHostAddress
in interfaceSshClient
-
getUsername
public String getUsername()
- Specified by:
getUsername
in interfaceSshClient
-
-