Subversion Repositories XServices

Rev

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;
70 brianR 22
import javax.xml.bind.annotation.XmlElement;
46 brianR 23
 
24
import net.brutex.xservices.types.HostConnection;
25
import net.brutex.xservices.types.ReturnCode;
26
import net.brutex.xservices.util.BrutexNamespaces;
27
 
65 brianR 28
/**
69 brianR 29
 * Task execution web service
70 brianR 30
 *
69 brianR 31
 * @author Brian Rosenberger
32
 * @since 0.1.0
65 brianR 33
 *
34
 */
46 brianR 35
@WebService(targetNamespace = BrutexNamespaces.WS_XSERVICES)
36
public interface ExecuteService {
37
 
65 brianR 38
	/**
39
	 * @param cmd
40
	 * @param args
41
	 * @param timeout
42
	 * @return
43
	 */
46 brianR 44
	@WebMethod(operationName = "runCommand")
45
	public abstract ReturnCode runCommand(
46
			@WebParam(name = "executable") String cmd,
47
			@WebParam(name = "argline") String args,
48
			@WebParam(name = "timeout") long timeout);
49
 
65 brianR 50
	/**
51
	 * @param cmd
52
	 * @param args
53
	 * @param timeout
54
	 * @return
55
	 */
46 brianR 56
	@WebMethod(operationName = "runCommandWithArgs")
57
	public abstract ReturnCode runCommandWithArgs(
58
			@WebParam(name = "executable") String cmd,
59
			@WebParam(name = "arg") String[] args,
60
			@WebParam(name = "timeout") long timeout);
61
 
65 brianR 62
	/**
63
	 * @param cmd
64
	 * @param args
65
	 * @return
66
	 */
46 brianR 67
	@WebMethod(operationName = "runCommandAsync")
68
	public abstract ReturnCode runCommandAsync(
69
			@WebParam(name = "executable") String cmd,
70
			@WebParam(name = "argline") String args);
71
 
65 brianR 72
	/**
73
	 * @param cmd
74
	 * @param args
75
	 * @return
76
	 */
46 brianR 77
	@WebMethod(operationName = "runCommandAsyncWithArgs")
78
	public abstract ReturnCode runCommandAsyncWithArgs(
79
			@WebParam(name = "executable") String cmd,
80
			@WebParam(name = "arg") String[] args);
81
 
65 brianR 82
	/**
83
	 * @param host
84
	 * @param cmd
85
	 * @param timeout
86
	 * @return
87
	 */
46 brianR 88
	@WebMethod(operationName = "runCommandWithSSH")
89
	public abstract ReturnCode runCommandWithSSH(
58 brianR 90
			@WebParam(name = "host") HostConnection host,
46 brianR 91
			@WebParam(name = "command") String cmd,
92
			@WebParam(name = "timeout") long timeout);
93
 
65 brianR 94
	/**
95
	 * @param host
96
	 * @param keyfile
97
	 * @param cmd
98
	 * @param timeout
99
	 * @return
100
	 */
46 brianR 101
	@WebMethod(operationName = "runCommandWithSSHKeyAuth")
102
	public abstract ReturnCode runCommandWithSSHKeyAuth(
58 brianR 103
			@WebParam(name = "host") HostConnection host,
46 brianR 104
			@WebParam(name = "keyfile") String keyfile,
105
			@WebParam(name = "command") String cmd,
106
			@WebParam(name = "timeout") long timeout);
107
 
65 brianR 108
	/**
109
	 * @param host
110
	 * @param cmd
111
	 * @param timeout
112
	 * @return
113
	 */
46 brianR 114
	@WebMethod(operationName = "rExec")
115
	public abstract ReturnCode rExec(
116
			@WebParam(name = "host") HostConnection host,
117
			@WebParam(name = "command") String cmd,
118
			@WebParam(name = "timeout") long timeout);
119
 
65 brianR 120
	/**
121
	 * @param host
122
	 * @param prompt
123
	 * @param cmd
124
	 * @param expect
125
	 * @param timeout
126
	 * @return
127
	 */
46 brianR 128
	@WebMethod(operationName = "telnet")
129
	public abstract ReturnCode runTelnet(
130
			@WebParam(name = "host") HostConnection host,
131
			@WebParam(name = "prompt") String prompt,
132
			@WebParam(name = "command") String cmd,
133
			@WebParam(name = "expect") String expect,
134
			@WebParam(name = "timeout") long timeout);
70 brianR 135
 
136
	/**
137
	 * @param script
138
	 * @throws XServicesFault
139
	 */
140
	@WebMethod(operationName = "runJavaScript")
141
	public abstract void runJScript(
142
			@WebParam(name = "script") @XmlElement(required=true) String script) throws XServicesFault;
143
 
46 brianR 144
 
145
}