org.ow2.jasmine.vmm.agent.driver.util
Class RemoteExec

java.lang.Object
  extended by org.ow2.jasmine.vmm.agent.driver.util.RemoteExec

public class RemoteExec
extends java.lang.Object

Utility class allowing to invoke commands on a remote host using SSH TODO: allows key-based authentification


Nested Class Summary
static class RemoteExec.Result
          Result of a remote SSH invocation
static class RemoteExec.SshException
           
 
Constructor Summary
RemoteExec()
           
 
Method Summary
static RemoteExec.Result command(java.lang.String host, java.lang.String user, java.lang.String password, java.lang.String command)
          Invoke a command through SSH on a remote host
static RemoteExec.Result commandAsRoot(java.lang.String host, java.lang.String password, java.lang.String command)
          Invoke a command through SSH on a remote host as root
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteExec

public RemoteExec()
Method Detail

commandAsRoot

public static RemoteExec.Result commandAsRoot(java.lang.String host,
                                              java.lang.String password,
                                              java.lang.String command)
                                       throws RemoteExec.SshException
Invoke a command through SSH on a remote host as root

Parameters:
host - target host
password - root password
command - command to exec on the remote host as root
Returns:
result of the invocation
Throws:
RemoteExec.SshException - raised if the SSH connection could not be established

command

public static RemoteExec.Result command(java.lang.String host,
                                        java.lang.String user,
                                        java.lang.String password,
                                        java.lang.String command)
                                 throws RemoteExec.SshException
Invoke a command through SSH on a remote host

Parameters:
host - target host
user - user login
password - user password
command - command to exec on the remote host
Returns:
result of the invocation
Throws:
RemoteExec.SshException - raised if the SSH connection could not be established


Copyright © 2009 OW2 Consortium. All Rights Reserved.