Subversion Repositories XServices

Rev

Rev 12 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12 Rev 19
Line 15... Line 15...
15
 */
15
 */
Line 16... Line 16...
16
 
16
 
Line 17... Line 17...
17
package net.brutex.xservices.ws;
17
package net.brutex.xservices.ws;
18
 
-
 
19
import java.io.File;
18
 
20
import java.util.Map;
19
import java.io.File;
21
import javax.jws.WebMethod;
20
import javax.jws.WebMethod;
-
 
21
import javax.jws.WebParam;
22
import javax.jws.WebParam;
22
import javax.jws.WebService;
23
import javax.jws.WebService;
23
import net.brutex.xservices.types.HostConnection;
24
import net.brutex.xservices.types.ReturnCode;
24
import net.brutex.xservices.types.ReturnCode;
25
import net.brutex.xservices.util.RunTask;
25
import net.brutex.xservices.util.RunTask;
26
import org.apache.tools.ant.taskdefs.ExecTask;
26
import org.apache.tools.ant.taskdefs.ExecTask;
Line 120... Line 120...
120
 
120
 
121
        return sshExecWithCert(host, username, passphrase, keyfile, port, cmd, timeout);
121
        return sshExecWithCert(host, username, passphrase, keyfile, port, cmd, timeout);
Line 122... Line 122...
122
    }
122
    }
123
 
123
 
124
    @WebMethod(operationName = "rExec")
-
 
125
    public ReturnCode rExec(@WebParam(name = "host") String host,
-
 
126
            @WebParam(name = "port") int port,
-
 
127
            @WebParam(name = "username") String username,
124
    @WebMethod(operationName = "rExec")
128
            @WebParam(name = "password") String password,
125
    public ReturnCode rExec(@WebParam(name = "host") HostConnection host,
129
            @WebParam(name = "command") String cmd,
126
            @WebParam(name = "command") String cmd,
130
            @WebParam(name = "timeout") long timeout) {
127
            @WebParam(name = "timeout") long timeout) {
Line 131... Line 128...
131
        return rexec(host, port, username, password, cmd, timeout);
128
        return rexec(host.hostname, host.port, host.user, host.password, cmd, timeout);
132
    }
129
    }
133
 
-
 
134
    @WebMethod(operationName = "telnet")
-
 
135
    public ReturnCode runTelnet(@WebParam(name = "host") String host,
-
 
136
            @WebParam(name = "port") int port,
130
 
137
            @WebParam(name = "username") String username,
131
    @WebMethod(operationName = "telnet")
138
            @WebParam(name = "password") String password,
132
    public ReturnCode runTelnet(@WebParam(name = "host") HostConnection host,
139
            @WebParam(name = "prompt") String prompt,
133
            @WebParam(name = "prompt") String prompt,
140
            @WebParam(name = "command") String cmd,
134
            @WebParam(name = "command") String cmd,
141
            @WebParam(name = "expect") String expect,
135
            @WebParam(name = "expect") String expect,
Line 142... Line 136...
142
            @WebParam(name = "timeout") long timeout) {
136
            @WebParam(name = "timeout") long timeout) {
143
        return telnet(host, port, username, password, cmd, timeout, prompt, expect);
137
        return telnet(host.hostname, host.port, host.user, host.password, cmd, timeout, prompt, expect);
144
    }
138
    }