Source Code Cross Referenced for TurbineXmlRpc.java in  » Web-Framework » TURBINE » org » apache » turbine » services » xmlrpc » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Web Framework » TURBINE » org.apache.turbine.services.xmlrpc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.apache.turbine.services.xmlrpc;
002:
003:        /*
004:         * Licensed to the Apache Software Foundation (ASF) under one
005:         * or more contributor license agreements.  See the NOTICE file
006:         * distributed with this work for additional information
007:         * regarding copyright ownership.  The ASF licenses this file
008:         * to you under the Apache License, Version 2.0 (the
009:         * "License"); you may not use this file except in compliance
010:         * with the License.  You may obtain a copy of the License at
011:         *
012:         *   http://www.apache.org/licenses/LICENSE-2.0
013:         *
014:         * Unless required by applicable law or agreed to in writing,
015:         * software distributed under the License is distributed on an
016:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017:         * KIND, either express or implied.  See the License for the
018:         * specific language governing permissions and limitations
019:         * under the License.
020:         */
021:
022:        import java.io.InputStream;
023:
024:        import java.net.URL;
025:
026:        import java.util.Vector;
027:
028:        import org.apache.turbine.services.TurbineServices;
029:        import org.apache.turbine.util.TurbineException;
030:
031:        /**
032:         * This is a static accesor class for {@link XmlRpcService}.
033:         *
034:         * @author <a href="mailto:magnus@handtolvur.is">Magnús Þór Torfason</a>
035:         * @author <a href="mailto:Rafal.Krzewski@e-point.pl">Rafal Krzewski</a>
036:         * @author <a href="mailto:jvanzyl@periapt.com">Jason van Zyl</a>
037:         * @version $Id: TurbineXmlRpc.java 534527 2007-05-02 16:10:59Z tv $
038:         */
039:        public abstract class TurbineXmlRpc {
040:            /**
041:             * Returns system's configured implementation of {@link XmlRpcService}.
042:             *
043:             * @return an implementaion of <code>XmlRpcService</code>
044:             */
045:            public static XmlRpcService getService() {
046:                return (XmlRpcService) TurbineServices.getInstance()
047:                        .getService(XmlRpcService.SERVICE_NAME);
048:            }
049:
050:            /**
051:             * Execute a remote procedure call.
052:             *
053:             * @param url A URL.
054:             * @param methodName A String with the method name.
055:             * @param params A Vector with the parameters.
056:             * @return An Object.
057:             * @exception TurbineException
058:             */
059:            public static Object executeRpc(URL url, String methodName,
060:                    Vector params) throws TurbineException {
061:                return getService().executeRpc(url, methodName, params);
062:            }
063:
064:            /**
065:             * Execute a remote procedure call taht requires authentication
066:             *
067:             * @param url A URL.
068:             * @param username The username to try and authenticate with
069:             * @param password The password to try and authenticate with
070:             * @param methodName A String with the method name.
071:             * @param params A Vector with the parameters.
072:             * @return An Object.
073:             * @exception TurbineException
074:             */
075:            public static Object executeAuthenticatedRpc(URL url,
076:                    String username, String password, String methodName,
077:                    Vector params) throws TurbineException {
078:                return getService().executeAuthenticatedRpc(url, username,
079:                        password, methodName, params);
080:            }
081:
082:            /**
083:             * Register an object as a handler for the XmlRpc Server part.
084:             *
085:             * @param handlerName The name under which we want
086:             * to register the service
087:             * @param handler The handler object
088:             */
089:            public static void registerHandler(String handlerName,
090:                    Object handler) {
091:                getService().registerHandler(handlerName, handler);
092:            }
093:
094:            /**
095:             * Register an object as a the default handler for
096:             * the XmlRpc Server part.
097:             *
098:             * @param handler The handler object
099:             */
100:            public static void registerHandler(Object handler) {
101:                getService().registerHandler(handler);
102:            }
103:
104:            /**
105:             * Unregister a handler.
106:             *
107:             * @param handlerName The name of the handler to unregister.
108:             */
109:            public static void unregisterHandler(String handlerName) {
110:                getService().unregisterHandler(handlerName);
111:            }
112:
113:            /**
114:             * Handle an XML-RPC request using the encapsulated server.
115:             *
116:             * You can use this method to handle a request from within
117:             * a Turbine screen.
118:             *
119:             * @param is the stream to read request data from.
120:             * @return the response body that needs to be sent to the client.
121:             */
122:            public static byte[] handleRequest(InputStream is) {
123:                return getService().handleRequest(is);
124:            }
125:
126:            /**
127:             * Handle an XML-RPC request using the encapsulated server with user
128:             * authentication.
129:             *
130:             * You can use this method to handle a request from within
131:             * a Turbine screen.
132:             *
133:             * <p> Note that the handlers need to implement AuthenticatedXmlRpcHandler
134:             * interface to access the authentication infomration.
135:             *
136:             * @param is the stream to read request data from.
137:             * @param user the user that is making the request.
138:             * @param password the password given by user.
139:             * @return the response body that needs to be sent to the client.
140:             */
141:            public static byte[] handleRequest(InputStream is, String user,
142:                    String password) {
143:                return getService().handleRequest(is, user, password);
144:            }
145:
146:            /**
147:             * Method to allow a client to send a file to a server.
148:             *
149:             * @param serverURL
150:             * @param sourceLocationProperty
151:             * @param sourceFileName
152:             * @param destinationLocationProperty
153:             * @param destinationFileName
154:             * @deprecated This is not scope of the Service itself but of an
155:             *             application which uses the service.
156:             */
157:            public static void send(String serverURL,
158:                    String sourceLocationProperty, String sourceFileName,
159:                    String destinationLocationProperty,
160:                    String destinationFileName) throws TurbineException {
161:                getService().send(serverURL, sourceLocationProperty,
162:                        sourceFileName, destinationLocationProperty,
163:                        destinationFileName);
164:            }
165:
166:            /**
167:             * Method to allow a client to send a file to a server that
168:             * requires authentication
169:             *
170:             * @param serverURL
171:             * @param username
172:             * @param password
173:             * @param sourceLocationProperty
174:             * @param sourceFileName
175:             * @param destinationLocationProperty
176:             * @param destinationFileName
177:             * @deprecated This is not scope of the Service itself but of an
178:             *             application which uses the service.
179:             */
180:            public static void send(String serverURL, String username,
181:                    String password, String sourceLocationProperty,
182:                    String sourceFileName, String destinationLocationProperty,
183:                    String destinationFileName) throws TurbineException {
184:                getService().send(serverURL, username, password,
185:                        sourceLocationProperty, sourceFileName,
186:                        destinationLocationProperty, destinationFileName);
187:            }
188:
189:            /**
190:             * Method to allow a client to get a file from a server.
191:             *
192:             * @param serverURL
193:             * @param sourceLocationProperty
194:             * @param sourceFileName
195:             * @param destinationLocationProperty
196:             * @param destinationFileName
197:             * @deprecated This is not scope of the Service itself but of an
198:             *             application which uses the service.
199:             */
200:            public static void get(String serverURL,
201:                    String sourceLocationProperty, String sourceFileName,
202:                    String destinationLocationProperty,
203:                    String destinationFileName) throws TurbineException {
204:                getService().get(serverURL, sourceLocationProperty,
205:                        sourceFileName, destinationLocationProperty,
206:                        destinationFileName);
207:            }
208:
209:            /**
210:             * Method to allow a client to get a file to a server that
211:             * requires authentication
212:             *
213:             * @param serverURL
214:             * @param username
215:             * @param password
216:             * @param sourceLocationProperty
217:             * @param sourceFileName
218:             * @param destinationLocationProperty
219:             * @param destinationFileName
220:             * @deprecated This is not scope of the Service itself but of an
221:             *             application which uses the service.
222:             */
223:            public static void get(String serverURL, String username,
224:                    String password, String sourceLocationProperty,
225:                    String sourceFileName, String destinationLocationProperty,
226:                    String destinationFileName) throws TurbineException {
227:                getService().get(serverURL, username, password,
228:                        sourceLocationProperty, sourceFileName,
229:                        destinationLocationProperty, destinationFileName);
230:            }
231:
232:            /**
233:             * Method to allow a client to remove a file from
234:             * the server
235:             *
236:             * @param serverURL
237:             * @param sourceLocationProperty
238:             * @param sourceFileName
239:             * @deprecated This is not scope of the Service itself but of an
240:             *             application which uses the service.
241:             */
242:            public static void remove(String serverURL,
243:                    String sourceLocationProperty, String sourceFileName)
244:                    throws TurbineException {
245:                getService().remove(serverURL, sourceLocationProperty,
246:                        sourceFileName);
247:            }
248:
249:            /**
250:             * Method to allow a client to remove a file from
251:             * a server that requires authentication
252:             *
253:             * @param serverURL
254:             * @param username
255:             * @param password
256:             * @param sourceLocationProperty
257:             * @param sourceFileName
258:             * @deprecated This is not scope of the Service itself but of an
259:             *             application which uses the service.
260:             */
261:            public static void remove(String serverURL, String username,
262:                    String password, String sourceLocationProperty,
263:                    String sourceFileName) throws TurbineException {
264:                getService().remove(serverURL, username, password,
265:                        sourceLocationProperty, sourceFileName);
266:            }
267:
268:            /**
269:             * Switch client filtering on/off.
270:             * @see #acceptClient(java.lang.String)
271:             * @see #denyClient(java.lang.String)
272:             */
273:            public static void setParanoid(boolean state) {
274:                getService().setParanoid(state);
275:            }
276:
277:            /**
278:             * Add an IP address to the list of accepted clients. The parameter can
279:             * contain '*' as wildcard character, e.g. "192.168.*.*". You must
280:             * call setParanoid(true) in order for this to have
281:             * any effect.
282:             *
283:             * @see #denyClient(java.lang.String)
284:             * @see #setParanoid(boolean)
285:             */
286:            public static void acceptClient(String address) {
287:                getService().acceptClient(address);
288:            }
289:
290:            /**
291:             * Add an IP address to the list of denied clients. The parameter can
292:             * contain '*' as wildcard character, e.g. "192.168.*.*". You must call
293:             * setParanoid(true) in order for this to have any effect.
294:             *
295:             * @see #acceptClient(java.lang.String)
296:             * @see #setParanoid(boolean)
297:             */
298:            public static void denyClient(String address) {
299:                getService().denyClient(address);
300:            }
301:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.