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)