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-fcafc1997a86tag-20130205r
parent
e192472e63
commit
ea59329a8c
|
@ -17,10 +17,10 @@
|
||||||
package net.brutex.xservices.ws;
|
package net.brutex.xservices.ws;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Map;
|
|
||||||
import javax.jws.WebMethod;
|
import javax.jws.WebMethod;
|
||||||
import javax.jws.WebParam;
|
import javax.jws.WebParam;
|
||||||
import javax.jws.WebService;
|
import javax.jws.WebService;
|
||||||
|
import net.brutex.xservices.types.HostConnection;
|
||||||
import net.brutex.xservices.types.ReturnCode;
|
import net.brutex.xservices.types.ReturnCode;
|
||||||
import net.brutex.xservices.util.RunTask;
|
import net.brutex.xservices.util.RunTask;
|
||||||
import org.apache.tools.ant.taskdefs.ExecTask;
|
import org.apache.tools.ant.taskdefs.ExecTask;
|
||||||
|
@ -122,25 +122,19 @@ public class ExecuteService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@WebMethod(operationName = "rExec")
|
@WebMethod(operationName = "rExec")
|
||||||
public ReturnCode rExec(@WebParam(name = "host") String host,
|
public ReturnCode rExec(@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 rexec(host, port, username, password, cmd, timeout);
|
return rexec(host.hostname, host.port, host.user, host.password, cmd, timeout);
|
||||||
}
|
}
|
||||||
|
|
||||||
@WebMethod(operationName = "telnet")
|
@WebMethod(operationName = "telnet")
|
||||||
public ReturnCode runTelnet(@WebParam(name = "host") String host,
|
public ReturnCode runTelnet(@WebParam(name = "host") HostConnection host,
|
||||||
@WebParam(name = "port") int port,
|
|
||||||
@WebParam(name = "username") String username,
|
|
||||||
@WebParam(name = "password") String password,
|
|
||||||
@WebParam(name = "prompt") String prompt,
|
@WebParam(name = "prompt") String prompt,
|
||||||
@WebParam(name = "command") String cmd,
|
@WebParam(name = "command") String cmd,
|
||||||
@WebParam(name = "expect") String expect,
|
@WebParam(name = "expect") String expect,
|
||||||
@WebParam(name = "timeout") long timeout) {
|
@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)
|
@WebMethod(exclude = true)
|
||||||
|
|
Loading…
Reference in New Issue