1 package org.apache.turbine.services.xmlrpc;
2
3 /* ====================================================================
4 * The Apache Software License, Version 1.1
5 *
6 * Copyright (c) 2001 The Apache Software Foundation. All rights
7 * reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 *
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 *
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in
18 * the documentation and/or other materials provided with the
19 * distribution.
20 *
21 * 3. The end-user documentation included with the redistribution,
22 * if any, must include the following acknowledgment:
23 * "This product includes software developed by the
24 * Apache Software Foundation (http://www.apache.org/)."
25 * Alternately, this acknowledgment may appear in the software itself,
26 * if and wherever such third-party acknowledgments normally appear.
27 *
28 * 4. The names "Apache" and "Apache Software Foundation" and
29 * "Apache Turbine" must not be used to endorse or promote products
30 * derived from this software without prior written permission. For
31 * written permission, please contact apache@apache.org.
32 *
33 * 5. Products derived from this software may not be called "Apache",
34 * "Apache Turbine", nor may "Apache" appear in their name, without
35 * prior written permission of the Apache Software Foundation.
36 *
37 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
38 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
39 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
40 * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
41 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
42 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
43 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
44 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
45 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
46 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
47 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
48 * SUCH DAMAGE.
49 * ====================================================================
50 *
51 * This software consists of voluntary contributions made by many
52 * individuals on behalf of the Apache Software Foundation. For more
53 * information on the Apache Software Foundation, please see
54 * <http://www.apache.org/>.
55 */
56
57 import helma.xmlrpc.XmlRpcException;
58 import java.util.Vector;
59 import java.io.IOException;
60 import java.io.InputStream;
61 import java.net.URL;
62 import org.apache.turbine.services.Service;
63 import org.apache.turbine.util.TurbineException;
64
65 /***
66 * The interface an XmlRpcService implements.
67 *
68 * @author <a href="mailto:josh@stonecottage.com">Josh Lucas</a>
69 * @author <a href="mailto:magnus@handtolvur.is">Magnús Þór Torfason</a>
70 * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
71 * @author <a href="jvanzyl@periapt.com">Jason van Zyl</a>
72 * @version $Id: XmlRpcService.java,v 1.1.1.1 2001/08/16 05:09:28 jvanzyl Exp $
73 */
74 public interface XmlRpcService
75 extends Service
76 {
77 /*** TurbineXmlRpcService. */
78 public static final String SERVICE_NAME = "XmlRpcService";
79
80 /***
81 * Execute a remote procedure call.
82 *
83 * @param url A URL.
84 * @param methodName A String with the method name.
85 * @param params A Vector with the parameters.
86 * @return An Object.
87 * @exception XmlRpcException.
88 * @exception IOException.
89 */
90 public Object executeRpc(URL url,
91 String methodName,
92 Vector params)
93 throws TurbineException;
94
95 /***
96 * Execute a remote procedure call taht requires
97 * authentication.
98 *
99 * @param url A URL.
100 * @param username The username to authenticate with
101 * @param password The password to authenticate with
102 * @param methodName A String with the method name.
103 * @param params A Vector with the parameters.
104 * @return An Object.
105 * @exception XmlRpcException.
106 * @exception IOException.
107 */
108 public Object executeAuthenticatedRpc(URL url,
109 String username,
110 String password,
111 String methodName,
112 Vector params)
113 throws TurbineException;
114
115 /***
116 * Register an object as a handler for the XmlRpc Server part.
117 *
118 * @param handlerName The name under which we want
119 * to register the service
120 * @param handler The handler object
121 * @exception XmlRpcException.
122 * @exception IOException.
123 */
124 public void registerHandler(String handlerName, Object handler)
125 throws XmlRpcException,
126 IOException;
127
128 /***
129 * Register an object as a the default handler for
130 * the XmlRpc Server part.
131 *
132 * @param handler The handler object
133 * @exception XmlRpcException.
134 * @exception IOException.
135 */
136 public void registerHandler(Object handler)
137 throws XmlRpcException,
138 IOException;
139
140 /***
141 * Unregister a handler.
142 *
143 * @param handlerName The name of the handler to unregister.
144 */
145 public void unregisterHandler(String handlerName);
146
147 /***
148 * Handle an XML-RPC request using the encapsulated server.
149 *
150 * You can use this method to handle a request from within
151 * a Turbine screen.
152 *
153 * @param is the stream to read request data from.
154 * @return the response body that needs to be sent to the client.
155 */
156 public byte[] handleRequest(InputStream is);
157
158 /***
159 * Handle an XML-RPC request using the encapsulated server with user
160 * authentication.
161 *
162 * You can use this method to handle a request from within
163 * a Turbine screen.
164 *
165 * <p> Note that the handlers need to implement AuthenticatedXmlRpcHandler
166 * interface to access the authentication infomration.
167 *
168 * @param is the stream to read request data from.
169 * @param user the user that is making the request.
170 * @param password the password given by user.
171 * @return the response body that needs to be sent to the client.
172 */
173 public byte[] handleRequest(InputStream is, String user, String password);
174
175 /***
176 * Method to allow a client to send a file to a server.
177 *
178 * @param serverURL
179 * @param sourceLocationProperty
180 * @param sourceFileName
181 * @param destinationLocationProperty
182 * @param destinationFileName
183 */
184 public void send(String serverURL,
185 String sourceLocationProperty,
186 String sourceFileName,
187 String destinationLocationProperty,
188 String destinationFileName)
189 throws Exception;
190 /***
191 * Method to allow a client to send a file to a server that
192 * requires authentication
193 *
194 * @param serverURL
195 * @param username
196 * @param password
197 * @param sourceLocationProperty
198 * @param sourceFileName
199 * @param destinationLocationProperty
200 * @param destinationFileName
201 */
202 public void send(String serverURL,
203 String username,
204 String password,
205 String sourceLocationProperty,
206 String sourceFileName,
207 String destinationLocationProperty,
208 String destinationFileName)
209 throws Exception;
210
211 /***
212 * Method to allow a client to send a file to a server.
213 *
214 * @param serverURL
215 * @param sourceLocationProperty
216 * @param sourceFileName
217 * @param destinationLocationProperty
218 * @param destinationFileName
219 */
220 public void get(String serverURL,
221 String sourceLocationProperty,
222 String sourceFileName,
223 String destinationLocationProperty,
224 String destinationFileName)
225 throws Exception;
226
227 /***
228 * Method to allow a client to send a file to a server that
229 * rewuires authentication
230 *
231 * @param serverURL
232 * @param username
233 * @param password
234 * @param sourceLocationProperty
235 * @param sourceFileName
236 * @param destinationLocationProperty
237 * @param destinationFileName
238 */
239 public void get(String serverURL,
240 String username,
241 String password,
242 String sourceLocationProperty,
243 String sourceFileName,
244 String destinationLocationProperty,
245 String destinationFileName)
246 throws Exception;
247
248 /***
249 * Method to allow a client to remove a file from
250 * the server
251 *
252 * @param serverURL
253 * @param sourceLocationProperty
254 * @param sourceFileName
255 */
256 public void remove(String serverURL,
257 String sourceLocationProperty,
258 String sourceFileName)
259 throws Exception;
260
261 /***
262 * Method to allow a client to remove a file from
263 * a server that requires authentication
264 *
265 * @param serverURL
266 * @param username
267 * @param password
268 * @param sourceLocationProperty
269 * @param sourceFileName
270 */
271 public void remove(String serverURL,
272 String username,
273 String password,
274 String sourceLocationProperty,
275 String sourceFileName)
276 throws Exception;
277
278 /***
279 * Switch client filtering on/off.
280 * @see #acceptClient(java.lang.String)
281 * @see #denyClient(java.lang.String)
282 */
283 public void setParanoid(boolean state);
284
285 /***
286 * Add an IP address to the list of accepted clients. The parameter can
287 * contain '*' as wildcard character, e.g. "192.168.*.*". You must
288 * call setParanoid(true) in order for this to have
289 * any effect.
290 *
291 * @see #denyClient(java.lang.String)
292 * @see #setParanoid(boolean)
293 */
294 public void acceptClient(String address);
295
296 /***
297 * Add an IP address to the list of denied clients. The parameter can
298 * contain '*' as wildcard character, e.g. "192.168.*.*". You must call
299 * setParanoid(true) in order for this to have any effect.
300 *
301 * @see #acceptClient(java.lang.String)
302 * @see #setParanoid(boolean)
303 */
304 public void denyClient(String address);
305
306 }
This page was automatically generated by Maven