1 package org.apache.turbine.services.xmlrpc; 2 3 18 19 import java.io.InputStream ; 20 21 import java.net.URL ; 22 23 import java.util.Vector ; 24 25 import org.apache.turbine.services.TurbineServices; 26 import org.apache.turbine.util.TurbineException; 27 28 36 public abstract class TurbineXmlRpc 37 { 38 43 public static XmlRpcService getService() 44 { 45 return (XmlRpcService) TurbineServices.getInstance() 46 .getService(XmlRpcService.SERVICE_NAME); 47 } 48 49 58 public static Object executeRpc(URL url, String methodName, Vector params) 59 throws TurbineException 60 { 61 return getService().executeRpc(url, methodName, params); 62 } 63 64 75 public static Object executeAuthenticatedRpc(URL url, String username, 76 String password, String methodName, Vector params) 77 throws TurbineException 78 { 79 return getService().executeAuthenticatedRpc(url, username, password, 80 methodName, params); 81 } 82 83 90 public static void registerHandler(String handlerName, Object handler) 91 { 92 getService().registerHandler(handlerName, handler); 93 } 94 95 101 public static void registerHandler(Object handler) 102 { 103 getService().registerHandler(handler); 104 } 105 106 111 public static void unregisterHandler(String handlerName) 112 { 113 getService().unregisterHandler(handlerName); 114 } 115 116 125 public static byte[] handleRequest(InputStream is) 126 { 127 return getService().handleRequest(is); 128 } 129 130 145 public static byte[] handleRequest(InputStream is, String user, String password) 146 { 147 return getService().handleRequest(is, user, password); 148 } 149 150 161 public static void send(String serverURL, 162 String sourceLocationProperty, 163 String sourceFileName, 164 String destinationLocationProperty, 165 String destinationFileName) 166 throws TurbineException 167 { 168 getService().send(serverURL, 169 sourceLocationProperty, 170 sourceFileName, 171 destinationLocationProperty, 172 destinationFileName); 173 } 174 175 189 public static void send(String serverURL, 190 String username, 191 String password, 192 String sourceLocationProperty, 193 String sourceFileName, 194 String destinationLocationProperty, 195 String destinationFileName) 196 throws TurbineException 197 { 198 getService().send(serverURL, 199 username, 200 password, 201 sourceLocationProperty, 202 sourceFileName, 203 destinationLocationProperty, 204 destinationFileName); 205 } 206 207 218 public static void get(String serverURL, 219 String sourceLocationProperty, 220 String sourceFileName, 221 String destinationLocationProperty, 222 String destinationFileName) 223 throws TurbineException 224 { 225 getService().get(serverURL, 226 sourceLocationProperty, 227 sourceFileName, 228 destinationLocationProperty, 229 destinationFileName); 230 } 231 232 246 public static void get(String serverURL, 247 String username, 248 String password, 249 String sourceLocationProperty, 250 String sourceFileName, 251 String destinationLocationProperty, 252 String destinationFileName) 253 throws TurbineException 254 { 255 getService().get(serverURL, 256 username, 257 password, 258 sourceLocationProperty, 259 sourceFileName, 260 destinationLocationProperty, 261 destinationFileName); 262 } 263 264 274 public static void remove(String serverURL, 275 String sourceLocationProperty, 276 String sourceFileName) 277 throws TurbineException 278 { 279 getService().remove(serverURL, 280 sourceLocationProperty, 281 sourceFileName); 282 } 283 284 296 public static void remove(String serverURL, 297 String username, 298 String password, 299 String sourceLocationProperty, 300 String sourceFileName) 301 throws TurbineException 302 { 303 getService().remove(serverURL, 304 username, 305 password, 306 sourceLocationProperty, 307 sourceFileName); 308 } 309 310 315 public static void setParanoid(boolean state) 316 { 317 getService().setParanoid(state); 318 } 319 320 329 public static void acceptClient(String address) 330 { 331 getService().acceptClient(address); 332 } 333 334 342 public static void denyClient(String address) 343 { 344 getService().denyClient(address); 345 } 346 } 347 | Popular Tags |