Changes SSH execution to use HostConnection type

git-svn-id: https://brutex.net/svn/xservices/trunk@58 e7e49efb-446e-492e-b9ec-fcafc1997a86
tag-20130205r
Brian Rosenberger 2011-04-22 19:44:08 +00:00
parent 24aa9d7982
commit 22de86be72
2 changed files with 6 additions and 18 deletions

View File

@ -35,19 +35,13 @@ public interface ExecuteService {
@WebMethod(operationName = "runCommandWithSSH")
public abstract ReturnCode runCommandWithSSH(
@WebParam(name = "host") String host,
@WebParam(name = "port") int port,
@WebParam(name = "username") String username,
@WebParam(name = "password") String password,
@WebParam(name = "host") HostConnection host,
@WebParam(name = "command") String cmd,
@WebParam(name = "timeout") long timeout);
@WebMethod(operationName = "runCommandWithSSHKeyAuth")
public abstract ReturnCode runCommandWithSSHKeyAuth(
@WebParam(name = "host") String host,
@WebParam(name = "port") int port,
@WebParam(name = "username") String username,
@WebParam(name = "passphrase") String passphrase,
@WebParam(name = "host") HostConnection host,
@WebParam(name = "keyfile") String keyfile,
@WebParam(name = "command") String cmd,
@WebParam(name = "timeout") long timeout);

View File

@ -126,14 +126,11 @@ public class ExecuteServiceImpl implements ExecuteService {
*/
@Override
@WebMethod(operationName = "runCommandWithSSH")
public ReturnCode runCommandWithSSH(@WebParam(name = "host") String host,
@WebParam(name = "port") int port,
@WebParam(name = "username") String username,
@WebParam(name = "password") String password,
public ReturnCode runCommandWithSSH(@WebParam(name = "host") HostConnection host,
@WebParam(name = "command") String cmd,
@WebParam(name = "timeout") long timeout) {
return sshExec(host, username, password, port, cmd, timeout);
return sshExec(host.hostname, host.user, host.password, host.port, cmd, timeout);
}
/* (non-Javadoc)
@ -141,15 +138,12 @@ public class ExecuteServiceImpl implements ExecuteService {
*/
@Override
@WebMethod(operationName = "runCommandWithSSHKeyAuth")
public ReturnCode runCommandWithSSHKeyAuth(@WebParam(name = "host") String host,
@WebParam(name = "port") int port,
@WebParam(name = "username") String username,
@WebParam(name = "passphrase") String passphrase,
public ReturnCode runCommandWithSSHKeyAuth(@WebParam(name = "host") HostConnection host,
@WebParam(name = "keyfile") String keyfile,
@WebParam(name = "command") String cmd,
@WebParam(name = "timeout") long timeout) {
return sshExecWithCert(host, username, passphrase, keyfile, port, cmd, timeout);
return sshExecWithCert(host.hostname, host.user, host.password, keyfile, host.port, cmd, timeout);
}
/* (non-Javadoc)