From 22de86be72f7419bbcb29d013cbd301b532df364 Mon Sep 17 00:00:00 2001 From: Brian Rosenberger Date: Fri, 22 Apr 2011 19:44:08 +0000 Subject: [PATCH] Changes SSH execution to use HostConnection type git-svn-id: https://brutex.net/svn/xservices/trunk@58 e7e49efb-446e-492e-b9ec-fcafc1997a86 --- .../net/brutex/xservices/ws/ExecuteService.java | 10 ++-------- .../xservices/ws/impl/ExecuteServiceImpl.java | 14 ++++---------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/src/java/net/brutex/xservices/ws/ExecuteService.java b/src/java/net/brutex/xservices/ws/ExecuteService.java index b882f56..c328544 100644 --- a/src/java/net/brutex/xservices/ws/ExecuteService.java +++ b/src/java/net/brutex/xservices/ws/ExecuteService.java @@ -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); diff --git a/src/java/net/brutex/xservices/ws/impl/ExecuteServiceImpl.java b/src/java/net/brutex/xservices/ws/impl/ExecuteServiceImpl.java index 79f3eb5..6c63c2a 100644 --- a/src/java/net/brutex/xservices/ws/impl/ExecuteServiceImpl.java +++ b/src/java/net/brutex/xservices/ws/impl/ExecuteServiceImpl.java @@ -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)