Subversion Repositories XServices

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
66 brianR 1
/*
2
 *   Copyright 2011 Brian Rosenberger (Brutex Network)
3
 *
4
 *   Licensed under the Apache License, Version 2.0 (the "License");
5
 *   you may not use this file except in compliance with the License.
6
 *   You may obtain a copy of the License at
7
 *
8
 *       http://www.apache.org/licenses/LICENSE-2.0
9
 *
10
 *   Unless required by applicable law or agreed to in writing, software
11
 *   distributed under the License is distributed on an "AS IS" BASIS,
12
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
 *   See the License for the specific language governing permissions and
14
 *   limitations under the License.
15
 */
16
 
46 brianR 17
package net.brutex.xservices.ws;
18
 
19
import javax.jws.WebMethod;
20
import javax.jws.WebParam;
21
import javax.jws.WebService;
22
 
23
import net.brutex.xservices.types.HostConnection;
24
import net.brutex.xservices.types.ReturnCode;
25
import net.brutex.xservices.util.BrutexNamespaces;
26
 
65 brianR 27
/**
69 brianR 28
 * Task execution web service
29
 * @author Brian Rosenberger
30
 * @since 0.1.0
65 brianR 31
 *
32
 */
46 brianR 33
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
34
public interface ExecuteService {
35
 
65 brianR 36
	/**
37
	 * @param cmd
38
	 * @param args
39
	 * @param timeout
40
	 * @return
41
	 */
46 brianR 42
	@WebMethod(operationName = "runCommand")
43
	public abstract ReturnCode runCommand(
44
			@WebParam(name = "executable") String cmd,
45
			@WebParam(name = "argline") String args,
46
			@WebParam(name = "timeout") long timeout);
47
 
65 brianR 48
	/**
49
	 * @param cmd
50
	 * @param args
51
	 * @param timeout
52
	 * @return
53
	 */
46 brianR 54
	@WebMethod(operationName = "runCommandWithArgs")
55
	public abstract ReturnCode runCommandWithArgs(
56
			@WebParam(name = "executable") String cmd,
57
			@WebParam(name = "arg") String[] args,
58
			@WebParam(name = "timeout") long timeout);
59
 
65 brianR 60
	/**
61
	 * @param cmd
62
	 * @param args
63
	 * @return
64
	 */
46 brianR 65
	@WebMethod(operationName = "runCommandAsync")
66
	public abstract ReturnCode runCommandAsync(
67
			@WebParam(name = "executable") String cmd,
68
			@WebParam(name = "argline") String args);
69
 
65 brianR 70
	/**
71
	 * @param cmd
72
	 * @param args
73
	 * @return
74
	 */
46 brianR 75
	@WebMethod(operationName = "runCommandAsyncWithArgs")
76
	public abstract ReturnCode runCommandAsyncWithArgs(
77
			@WebParam(name = "executable") String cmd,
78
			@WebParam(name = "arg") String[] args);
79
 
65 brianR 80
	/**
81
	 * @param host
82
	 * @param cmd
83
	 * @param timeout
84
	 * @return
85
	 */
46 brianR 86
	@WebMethod(operationName = "runCommandWithSSH")
87
	public abstract ReturnCode runCommandWithSSH(
58 brianR 88
			@WebParam(name = "host") HostConnection host,
46 brianR 89
			@WebParam(name = "command") String cmd,
90
			@WebParam(name = "timeout") long timeout);
91
 
65 brianR 92
	/**
93
	 * @param host
94
	 * @param keyfile
95
	 * @param cmd
96
	 * @param timeout
97
	 * @return
98
	 */
46 brianR 99
	@WebMethod(operationName = "runCommandWithSSHKeyAuth")
100
	public abstract ReturnCode runCommandWithSSHKeyAuth(
58 brianR 101
			@WebParam(name = "host") HostConnection host,
46 brianR 102
			@WebParam(name = "keyfile") String keyfile,
103
			@WebParam(name = "command") String cmd,
104
			@WebParam(name = "timeout") long timeout);
105
 
65 brianR 106
	/**
107
	 * @param host
108
	 * @param cmd
109
	 * @param timeout
110
	 * @return
111
	 */
46 brianR 112
	@WebMethod(operationName = "rExec")
113
	public abstract ReturnCode rExec(
114
			@WebParam(name = "host") HostConnection host,
115
			@WebParam(name = "command") String cmd,
116
			@WebParam(name = "timeout") long timeout);
117
 
65 brianR 118
	/**
119
	 * @param host
120
	 * @param prompt
121
	 * @param cmd
122
	 * @param expect
123
	 * @param timeout
124
	 * @return
125
	 */
46 brianR 126
	@WebMethod(operationName = "telnet")
127
	public abstract ReturnCode runTelnet(
128
			@WebParam(name = "host") HostConnection host,
129
			@WebParam(name = "prompt") String prompt,
130
			@WebParam(name = "command") String cmd,
131
			@WebParam(name = "expect") String expect,
132
			@WebParam(name = "timeout") long timeout);
133
 
134
}