org.opengroupware.jogi.connect.xmlrpc
Class ApacheXmlRpcCaller

java.lang.Object
  extended byorg.opengroupware.jogi.connect.xmlrpc.ApacheXmlRpcCaller
All Implemented Interfaces:
XmlRpcCaller

public class ApacheXmlRpcCaller
extends java.lang.Object
implements XmlRpcCaller

This class is an Wrapper arround the Apache-XMLRPC library. It provides implementations for calling remote methods and for basic user authentification.

Author:
Werner Schuster (murphee), Andreas Rath (teddius), Walter Christian (wolti)

Field Summary
static java.lang.String xmlrpcEncoding_
           
 
Constructor Summary
ApacheXmlRpcCaller(java.lang.String url, java.lang.String user, java.lang.String password)
           
 
Method Summary
 java.lang.String getUsername()
          Returns the current username used for authentificating against the OpenGroupware server.
 java.lang.Object invoke(java.lang.String method_name)
           
 java.lang.Object invoke(java.lang.String method_name, int integer)
           
 java.lang.Object invoke(java.lang.String method_name, java.util.List param_list)
          This invokes a XML-RPC call.
 java.lang.Object invoke(java.lang.String method_name, java.lang.String string)
           
 void setPassword(java.lang.String passwd)
          Sets the new password used for authentification against the remote OpenGroupware server.
 void setUser(java.lang.String user)
          Sets the user name used for remote authentification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlrpcEncoding_

public static final java.lang.String xmlrpcEncoding_
See Also:
Constant Field Values
Constructor Detail

ApacheXmlRpcCaller

public ApacheXmlRpcCaller(java.lang.String url,
                          java.lang.String user,
                          java.lang.String password)
                   throws ConnectionException
Method Detail

invoke

public java.lang.Object invoke(java.lang.String method_name,
                               java.lang.String string)
                        throws ConnectionException,
                               OgoException
Specified by:
invoke in interface XmlRpcCaller
Throws:
ConnectionException
OgoException

invoke

public java.lang.Object invoke(java.lang.String method_name)
                        throws ConnectionException,
                               OgoException
Throws:
ConnectionException
OgoException

invoke

public java.lang.Object invoke(java.lang.String method_name,
                               int integer)
                        throws ConnectionException,
                               OgoException
Specified by:
invoke in interface XmlRpcCaller
Throws:
ConnectionException
OgoException

invoke

public java.lang.Object invoke(java.lang.String method_name,
                               java.util.List param_list)
                        throws ConnectionException,
                               OgoException
Description copied from interface: XmlRpcCaller
This invokes a XML-RPC call. Use this to provide an adapter to an own XML-RPC library or to customize the way these calls are handled (eg. use SSL transport,...). The returned values must be consitant with the Apache XML-RPC librarys mapping of XML-RPC types to Java types. For collection classes, JOGI currently expects return values to be java.util.Vector for XML-RPC "array" and java.util.Hashtable for XML-RPC "struct". This is mostly due to the fact that the Apache XML-RPC library uses those. CAUTION: future versions of JOGI will require these mappings to be java.util.List (for "array") and java.util.Map (for "struct"), especially to make sure future streaming versions work too.

Specified by:
invoke in interface XmlRpcCaller
Parameters:
method_name - the name of the XmlRpc method to call.
param_list - the arguments for the remote method.
Returns:
whatever the XmlRpc library returns (see text above for details).
Throws:
ConnectionException
OgoException

setUser

public void setUser(java.lang.String user)
Description copied from interface: XmlRpcCaller
Sets the user name used for remote authentification.

Specified by:
setUser in interface XmlRpcCaller
Parameters:
user - The new username to use for authentificating against the remote OpenGroupware server.

getUsername

public java.lang.String getUsername()
Description copied from interface: XmlRpcCaller
Returns the current username used for authentificating against the OpenGroupware server.

Specified by:
getUsername in interface XmlRpcCaller
Returns:
The username used for authentification.

setPassword

public void setPassword(java.lang.String passwd)
Description copied from interface: XmlRpcCaller
Sets the new password used for authentification against the remote OpenGroupware server.

Specified by:
setPassword in interface XmlRpcCaller
Parameters:
passwd - The password used for authentification.


Copyright © 2003 ogojogi Project, All Rights Reserved.