Changed rExec and telnet operations to make use of the HostConnection type

git-svn-id: https://brutex.net/svn/xservices/trunk@19 e7e49efb-446e-492e-b9ec-fcafc1997a86
tag-20130205r
Brian Rosenberger 2010-02-13 17:45:27 +00:00
parent e192472e63
commit ea59329a8c
1 changed files with 5 additions and 11 deletions

View File

@ -17,10 +17,10 @@
package net.brutex.xservices.ws;
import java.io.File;
import java.util.Map;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import net.brutex.xservices.types.HostConnection;
import net.brutex.xservices.types.ReturnCode;
import net.brutex.xservices.util.RunTask;
import org.apache.tools.ant.taskdefs.ExecTask;
@ -122,25 +122,19 @@ public class ExecuteService {
}
@WebMethod(operationName = "rExec")
public ReturnCode rExec(@WebParam(name = "host") String host,
@WebParam(name = "port") int port,
@WebParam(name = "username") String username,
@WebParam(name = "password") String password,
public ReturnCode rExec(@WebParam(name = "host") HostConnection host,
@WebParam(name = "command") String cmd,
@WebParam(name = "timeout") long timeout) {
return rexec(host, port, username, password, cmd, timeout);
return rexec(host.hostname, host.port, host.user, host.password, cmd, timeout);
}
@WebMethod(operationName = "telnet")
public ReturnCode runTelnet(@WebParam(name = "host") String host,
@WebParam(name = "port") int port,
@WebParam(name = "username") String username,
@WebParam(name = "password") String password,
public ReturnCode runTelnet(@WebParam(name = "host") HostConnection host,
@WebParam(name = "prompt") String prompt,
@WebParam(name = "command") String cmd,
@WebParam(name = "expect") String expect,
@WebParam(name = "timeout") long timeout) {
return telnet(host, port, username, password, cmd, timeout, prompt, expect);
return telnet(host.hostname, host.port, host.user, host.password, cmd, timeout, prompt, expect);
}
@WebMethod(exclude = true)