org.opengroupware.jogi.connect.xmlrpc
Class XmlRpcConnection

java.lang.Object
  extended byorg.opengroupware.jogi.connect.xmlrpc.XmlRpcConnection
All Implemented Interfaces:
Connection, XmlRpcCaller

public class XmlRpcConnection
extends java.lang.Object
implements Connection, XmlRpcCaller

The class that represents an XmlRpcConnection. This is meant to provide the notion of a connection to an otherwise connection-less type of RPC. The class implements the XmlRpcCaller interface, but currently only delegates the calls to it. Future versions might allow optimizations like queuing etc. to be implemented inside XmlRpcConnection. This also makes it easier to exchange the XmlRpcCaller instance at runtimein case that might be needed at some point.

Author:
Werner Schuster

Constructor Summary
XmlRpcConnection(XmlRpcCaller caller)
           
 
Method Summary
 void closeConnection()
           
 void flushChanges()
           
 OpenGroupWare getOpenGroupWareInstance()
           
 java.lang.String getUsername()
          Returns the current username used for authentificating against the OpenGroupware server.
 XmlRpcCaller getXmlRpcCaller()
           
 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
 

Constructor Detail

XmlRpcConnection

public XmlRpcConnection(XmlRpcCaller caller)
Method Detail

getXmlRpcCaller

public XmlRpcCaller getXmlRpcCaller()

getOpenGroupWareInstance

public OpenGroupWare getOpenGroupWareInstance()
Specified by:
getOpenGroupWareInstance in interface Connection

closeConnection

public void closeConnection()
Specified by:
closeConnection in interface Connection

flushChanges

public void flushChanges()
Specified by:
flushChanges in interface Connection

invoke

public java.lang.Object invoke(java.lang.String method_name,
                               java.util.List param_list)
                        throws OgoException,
                               ConnectionException
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:
OgoException
ConnectionException

invoke

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

invoke

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

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.

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.


Copyright © 2003 ogojogi Project, All Rights Reserved.