org.apache.turbine.services.xmlrpc
Class TurbineXmlRpc

java.lang.Object
  |
  +--org.apache.turbine.services.xmlrpc.TurbineXmlRpc

public abstract class TurbineXmlRpc
extends java.lang.Object

This is a static accesor class for XmlRpcService.

Author:
Magnús Þór Torfason, Rafal Krzewski, Jason van Zyl

Constructor Summary
TurbineXmlRpc()
           
 
Method Summary
static void acceptClient(java.lang.String address)
          Add an IP address to the list of accepted clients.
static void denyClient(java.lang.String address)
          Add an IP address to the list of denied clients.
static java.lang.Object executeRpc(java.net.URL url, java.lang.String methodName, java.util.Vector params)
          Execute a remote procedure call.
static void get(java.lang.String serverURL, java.lang.String sourceLocationProperty, java.lang.String sourceFileName, java.lang.String destinationLocationProperty, java.lang.String destinationFileName)
          Method to allow a client to get a file to a server.
static XmlRpcService getService()
          Returns system's configured implementation of XmlRpcService.
static byte[] handleRequest(java.io.InputStream is)
          Handle an XML-RPC request using the encapsulated server.
static byte[] handleRequest(java.io.InputStream is, java.lang.String user, java.lang.String password)
          Handle an XML-RPC request using the encapsulated server with user authentication.
static void registerHandler(java.lang.Object handler)
          Register an object as a the default handler for the XmlRpc Server part.
static void registerHandler(java.lang.String handlerName, java.lang.Object handler)
          Register an object as a handler for the XmlRpc Server part.
static void remove(java.lang.String serverURL, java.lang.String sourceLocationProperty, java.lang.String sourceFileName)
          Method to allow a client to remove a file from the server
static void send(java.lang.String serverURL, java.lang.String sourceLocationProperty, java.lang.String sourceFileName, java.lang.String destinationLocationProperty, java.lang.String destinationFileName)
          Method to allow a client to send a file to a server.
static void setParanoid(boolean state)
          Switch client filtering on/off.
static void unregisterHandler(java.lang.String handlerName)
          Unregister a handler.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Constructor Detail

TurbineXmlRpc

public TurbineXmlRpc()
Method Detail

getService

public static XmlRpcService getService()
Returns system's configured implementation of XmlRpcService.
Returns:
an implementaion of XmlRpcService

executeRpc

public static java.lang.Object executeRpc(java.net.URL url,
                                          java.lang.String methodName,
                                          java.util.Vector params)
                                   throws TurbineException
Execute a remote procedure call.
Parameters:
url - A URL.
methodName - A String with the method name.
params - A Vector with the parameters.
Returns:
An Object.
Throws:
XmlRpcException. -  
IOException. -  

registerHandler

public static void registerHandler(java.lang.String handlerName,
                                   java.lang.Object handler)
                            throws helma.xmlrpc.XmlRpcException,
                                   java.io.IOException
Register an object as a handler for the XmlRpc Server part.
Parameters:
handlerName - The name under which we want to register the service
handler - The handler object
Throws:
XmlRpcException. -  
IOException. -  

registerHandler

public static void registerHandler(java.lang.Object handler)
                            throws helma.xmlrpc.XmlRpcException,
                                   java.io.IOException
Register an object as a the default handler for the XmlRpc Server part.
Parameters:
handler - The handler object
Throws:
XmlRpcException. -  
IOException. -  

unregisterHandler

public static void unregisterHandler(java.lang.String handlerName)
Unregister a handler.
Parameters:
handlerName - The name of the handler to unregister.

handleRequest

public static byte[] handleRequest(java.io.InputStream is)
Handle an XML-RPC request using the encapsulated server. You can use this method to handle a request from within a Turbine screen.
Parameters:
is - the stream to read request data from.
Returns:
the response body that needs to be sent to the client.

handleRequest

public static byte[] handleRequest(java.io.InputStream is,
                                   java.lang.String user,
                                   java.lang.String password)
Handle an XML-RPC request using the encapsulated server with user authentication. You can use this method to handle a request from within a Turbine screen.

Note that the handlers need to implement AuthenticatedXmlRpcHandler interface to access the authentication infomration.

Parameters:
is - the stream to read request data from.
user - the user that is making the request.
password - the password given by user.
Returns:
the response body that needs to be sent to the client.

send

public static void send(java.lang.String serverURL,
                        java.lang.String sourceLocationProperty,
                        java.lang.String sourceFileName,
                        java.lang.String destinationLocationProperty,
                        java.lang.String destinationFileName)
                 throws java.lang.Exception
Method to allow a client to send a file to a server.
Parameters:
serverURL -  
sourceLocationProperty -  
sourceFileName -  
destinationLocationProperty -  
destinationFileName -  

get

public static void get(java.lang.String serverURL,
                       java.lang.String sourceLocationProperty,
                       java.lang.String sourceFileName,
                       java.lang.String destinationLocationProperty,
                       java.lang.String destinationFileName)
                throws java.lang.Exception
Method to allow a client to get a file to a server.
Parameters:
serverURL -  
sourceLocationProperty -  
sourceFileName -  
destinationLocationProperty -  
destinationFileName -  

remove

public static void remove(java.lang.String serverURL,
                          java.lang.String sourceLocationProperty,
                          java.lang.String sourceFileName)
                   throws java.lang.Exception
Method to allow a client to remove a file from the server
Parameters:
serverURL -  
sourceLocationProperty -  
sourceFileName -  

setParanoid

public static void setParanoid(boolean state)
Switch client filtering on/off.
See Also:
acceptClient(java.lang.String), denyClient(java.lang.String)

acceptClient

public static void acceptClient(java.lang.String address)
Add an IP address to the list of accepted clients. The parameter can contain '*' as wildcard character, e.g. "192.168.*.*". You must call setParanoid(true) in order for this to have any effect.
See Also:
denyClient(java.lang.String), setParanoid(boolean)

denyClient

public static void denyClient(java.lang.String address)
Add an IP address to the list of denied clients. The parameter can contain '*' as wildcard character, e.g. "192.168.*.*". You must call setParanoid(true) in order for this to have any effect.
See Also:
acceptClient(java.lang.String), setParanoid(boolean)


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.