Changes SSH execution to use HostConnection type
git-svn-id: https://brutex.net/svn/xservices/trunk@58 e7e49efb-446e-492e-b9ec-fcafc1997a86tag-20130205r
parent
24aa9d7982
commit
22de86be72
|
@ -35,19 +35,13 @@ public interface ExecuteService {
|
||||||
|
|
||||||
@WebMethod(operationName = "runCommandWithSSH")
|
@WebMethod(operationName = "runCommandWithSSH")
|
||||||
public abstract ReturnCode runCommandWithSSH(
|
public abstract ReturnCode runCommandWithSSH(
|
||||||
@WebParam(name = "host") String host,
|
@WebParam(name = "host") HostConnection host,
|
||||||
@WebParam(name = "port") int port,
|
|
||||||
@WebParam(name = "username") String username,
|
|
||||||
@WebParam(name = "password") String password,
|
|
||||||
@WebParam(name = "command") String cmd,
|
@WebParam(name = "command") String cmd,
|
||||||
@WebParam(name = "timeout") long timeout);
|
@WebParam(name = "timeout") long timeout);
|
||||||
|
|
||||||
@WebMethod(operationName = "runCommandWithSSHKeyAuth")
|
@WebMethod(operationName = "runCommandWithSSHKeyAuth")
|
||||||
public abstract ReturnCode runCommandWithSSHKeyAuth(
|
public abstract ReturnCode runCommandWithSSHKeyAuth(
|
||||||
@WebParam(name = "host") String host,
|
@WebParam(name = "host") HostConnection host,
|
||||||
@WebParam(name = "port") int port,
|
|
||||||
@WebParam(name = "username") String username,
|
|
||||||
@WebParam(name = "passphrase") String passphrase,
|
|
||||||
@WebParam(name = "keyfile") String keyfile,
|
@WebParam(name = "keyfile") String keyfile,
|
||||||
@WebParam(name = "command") String cmd,
|
@WebParam(name = "command") String cmd,
|
||||||
@WebParam(name = "timeout") long timeout);
|
@WebParam(name = "timeout") long timeout);
|
||||||
|
|
|
@ -126,14 +126,11 @@ public class ExecuteServiceImpl implements ExecuteService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@WebMethod(operationName = "runCommandWithSSH")
|
@WebMethod(operationName = "runCommandWithSSH")
|
||||||
public ReturnCode runCommandWithSSH(@WebParam(name = "host") String host,
|
public ReturnCode runCommandWithSSH(@WebParam(name = "host") HostConnection host,
|
||||||
@WebParam(name = "port") int port,
|
|
||||||
@WebParam(name = "username") String username,
|
|
||||||
@WebParam(name = "password") String password,
|
|
||||||
@WebParam(name = "command") String cmd,
|
@WebParam(name = "command") String cmd,
|
||||||
@WebParam(name = "timeout") long timeout) {
|
@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)
|
/* (non-Javadoc)
|
||||||
|
@ -141,15 +138,12 @@ public class ExecuteServiceImpl implements ExecuteService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@WebMethod(operationName = "runCommandWithSSHKeyAuth")
|
@WebMethod(operationName = "runCommandWithSSHKeyAuth")
|
||||||
public ReturnCode runCommandWithSSHKeyAuth(@WebParam(name = "host") String host,
|
public ReturnCode runCommandWithSSHKeyAuth(@WebParam(name = "host") HostConnection host,
|
||||||
@WebParam(name = "port") int port,
|
|
||||||
@WebParam(name = "username") String username,
|
|
||||||
@WebParam(name = "passphrase") String passphrase,
|
|
||||||
@WebParam(name = "keyfile") String keyfile,
|
@WebParam(name = "keyfile") String keyfile,
|
||||||
@WebParam(name = "command") String cmd,
|
@WebParam(name = "command") String cmd,
|
||||||
@WebParam(name = "timeout") long timeout) {
|
@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)
|
/* (non-Javadoc)
|
||||||
|
|
Loading…
Reference in New Issue