org.jclouds.ssh.jsch
Class JschSshClient

java.lang.Object
  extended by org.jclouds.ssh.jsch.JschSshClient
All Implemented Interfaces:
org.jclouds.ssh.SshClient

public class JschSshClient
extends Object
implements org.jclouds.ssh.SshClient

This class needs refactoring. It is not thread safe.

Author:
Adrian Cole

Nested Class Summary
static interface JschSshClient.Connection<T>
           
static interface JschSshClient.ConnectionWithStreams<T>
           
 
Nested classes/interfaces inherited from interface org.jclouds.ssh.SshClient
org.jclouds.ssh.SshClient.Factory
 
Field Summary
protected  org.jclouds.logging.Logger logger
           
 
Constructor Summary
JschSshClient(org.jclouds.http.handlers.BackoffLimitedRetryHandler backoffLimitedRetryHandler, com.google.common.net.HostAndPort socket, org.jclouds.domain.LoginCredentials loginCredentials, int timeout)
           
 
Method Summary
protected
<T,C extends JschSshClient.Connection<T>>
T
acquire(C connection)
           
 void connect()
           
 void disconnect()
           
 org.jclouds.compute.domain.ExecResponse exec(String command)
           
 org.jclouds.compute.domain.ExecChannel execChannel(String command)
           
protected  JschSshClient.ConnectionWithStreams<com.jcraft.jsch.ChannelExec> execConnection(String command)
           
 org.jclouds.io.Payload get(String path)
           
 String getHostAddress()
           
 String getUsername()
           
 void put(String path, org.jclouds.io.Payload contents)
           
 void put(String path, String contents)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

@Named(value="jclouds.ssh")
protected org.jclouds.logging.Logger logger
Constructor Detail

JschSshClient

public JschSshClient(org.jclouds.http.handlers.BackoffLimitedRetryHandler backoffLimitedRetryHandler,
                     com.google.common.net.HostAndPort socket,
                     org.jclouds.domain.LoginCredentials loginCredentials,
                     int timeout)
Method Detail

put

public void put(String path,
                String contents)
Specified by:
put in interface org.jclouds.ssh.SshClient

acquire

protected <T,C extends JschSshClient.Connection<T>> T acquire(C connection)

connect

public void connect()
Specified by:
connect in interface org.jclouds.ssh.SshClient

get

public org.jclouds.io.Payload get(String path)
Specified by:
get in interface org.jclouds.ssh.SshClient

put

public void put(String path,
                org.jclouds.io.Payload contents)
Specified by:
put in interface org.jclouds.ssh.SshClient

toString

public String toString()
Overrides:
toString in class Object

disconnect

@PreDestroy
public void disconnect()
Specified by:
disconnect in interface org.jclouds.ssh.SshClient

execConnection

protected JschSshClient.ConnectionWithStreams<com.jcraft.jsch.ChannelExec> execConnection(String command)

exec

public org.jclouds.compute.domain.ExecResponse exec(String command)
Specified by:
exec in interface org.jclouds.ssh.SshClient

getHostAddress

public String getHostAddress()
Specified by:
getHostAddress in interface org.jclouds.ssh.SshClient

getUsername

public String getUsername()
Specified by:
getUsername in interface org.jclouds.ssh.SshClient

execChannel

public org.jclouds.compute.domain.ExecChannel execChannel(String command)
Specified by:
execChannel in interface org.jclouds.ssh.SshClient


Copyright © 2009-2012 jclouds. All Rights Reserved.