Package org.jclouds.sshj
Class SshjSshClient
- java.lang.Object
-
- org.jclouds.sshj.SshjSshClient
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSshjSshClient.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)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 SshjSshClient.Connection<net.schmizz.sshj.connection.channel.direct.Session>execConnection()Payloadget(String path)StringgetHostAddress()StringgetUsername()booleanisConnected()protected SshjSshClient.Connection<net.schmizz.sshj.connection.channel.direct.Session>noPTYConnection()voidput(String path, String contents)voidput(String path, Payload contents)StringtoString()
-
-
-
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:
disconnectin interfaceSshClient
-
isConnected
public boolean isConnected()
- Specified by:
isConnectedin interfaceSshClient
-
execConnection
protected SshjSshClient.Connection<net.schmizz.sshj.connection.channel.direct.Session> execConnection()
-
exec
public ExecResponse exec(String command)
Description copied from interface:SshClientExecute 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: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
-
getHostAddress
public String getHostAddress()
- Specified by:
getHostAddressin interfaceSshClient
-
getUsername
public String getUsername()
- Specified by:
getUsernamein interfaceSshClient
-
-