org.opengroupware.jogi.connect.xmlrpc
Class XmlRpcContactManager

java.lang.Object
  extended byorg.opengroupware.jogi.connect.xmlrpc.XmlRpcContactManager
All Implemented Interfaces:
ContactManager, java.util.Observer

public class XmlRpcContactManager
extends java.lang.Object
implements java.util.Observer, ContactManager

Holds all the contacts in the OGo database. This combines Person and Enterprise information, as they both are logically contacts. The ContactManager is able to fetch Enterprises and Person with vary attributes.

Author:
Andreas Rath (teddius)

Field Summary
protected  java.util.Map cached_enterprises_
           
protected  java.util.Map cached_persons_
           
static java.lang.String CONTACTMANAGER_ENTERPRISE_DELETE
           
static java.lang.String CONTACTMANAGER_ENTERPRISE_DELETE_PERSON
           
static java.lang.String CONTACTMANAGER_ENTERPRISE_FETCH
           
static java.lang.String CONTACTMANAGER_ENTERPRISE_FETCH_IDS
           
static java.lang.String CONTACTMANAGER_ENTERPRISE_FETCH_PERSONS
           
static java.lang.String CONTACTMANAGER_ENTERPRISE_GET
           
static java.lang.String CONTACTMANAGER_ENTERPRISE_GET_BY_ID
           
static java.lang.String CONTACTMANAGER_ENTERPRISE_GET_BY_NUMBER
           
static java.lang.String CONTACTMANAGER_ENTERPRISE_GET_PERSONS
           
static java.lang.String CONTACTMANAGER_ENTERPRISE_GET_PROJECTS
           
static java.lang.String CONTACTMANAGER_ENTERPRISE_INSERT
           
static java.lang.String CONTACTMANAGER_ENTERPRISE_INSERT_PERSON
           
static java.lang.String CONTACTMANAGER_ENTERPRISE_UPDATE
           
static java.lang.String CONTACTMANAGER_PERSON_DELETE
           
static java.lang.String CONTACTMANAGER_PERSON_DELETE_BY_NUMBER
           
static java.lang.String CONTACTMANAGER_PERSON_DELETE_ENTERPRISE
           
static java.lang.String CONTACTMANAGER_PERSON_FETCH
           
static java.lang.String CONTACTMANAGER_PERSON_FETCH_ENTERPRISES
           
static java.lang.String CONTACTMANAGER_PERSON_FETCH_IDS
           
static java.lang.String CONTACTMANAGER_PERSON_FETCH_JOB_IDS
           
static java.lang.String CONTACTMANAGER_PERSON_FETCH_JOBS
           
static java.lang.String CONTACTMANAGER_PERSON_GET_BY_ATTRIBUTES
           
static java.lang.String CONTACTMANAGER_PERSON_GET_BY_ID
           
static java.lang.String CONTACTMANAGER_PERSON_GET_BY_NUMBER
           
static java.lang.String CONTACTMANAGER_PERSON_GET_ENTERPRISES
           
static java.lang.String CONTACTMANAGER_PERSON_INSERT
           
static java.lang.String CONTACTMANAGER_PERSON_INSERT_ENTERPRISE
           
static java.lang.String CONTACTMANAGER_PERSON_INSERT_JOB
           
static java.lang.String CONTACTMANAGER_PERSON_UPDATE
           
static java.lang.String CONTACTMANAGER_PERSON_UPDATE_JOB
           
protected  OpenGroupWare ogo
           
protected  XmlRpcCaller xmlcaller_
           
 
Constructor Summary
XmlRpcContactManager(XmlRpcCaller caller, OpenGroupWare ogo)
           
 
Method Summary
 void commitUpdate()
           
protected  XmlRpcEnterprise createNewEnterprise(java.util.Map content)
           
protected  XmlRpcPerson createNewPerson(java.util.Map content)
           
 void delete(Enterprise enterprise)
           
 void delete(Person person)
           
 java.util.Iterator fetchContacts(FetchSpecification fspec)
          Fetches both Person and Enterprise records that match the FetchSpecification.
 java.lang.Object fetchEnterpriseMapId(int integer)
           
 java.util.Iterator fetchEnterprises(FetchSpecification fspec)
          Fetches only Enterprise records that match the FetchSpecification.
 java.lang.Object fetchPersonMapId(int integer)
           
 java.util.Iterator fetchPersons(FetchSpecification fspec)
          Fetches only Person records that match the FetchSpecification.
protected  XmlRpcEnterprise getCachedEnterprise(java.lang.Object obj)
           
protected  XmlRpcPerson getCachedPerson(java.lang.Object obj)
           
 Enterprise getEnterprise(int number)
           
 Enterprise getEnterprise(java.lang.String number)
           
 Enterprise getEnterpriseById(java.lang.String id)
           
 java.util.Iterator getEnterprises(java.util.Map attributes)
           
 java.util.Iterator getEnterprisesByAttributes(java.util.Map attributes)
          Gets the Iterator of a List of Enterprise objects that have the attributes contained in the attributes argument.
 Person getPersonById(java.lang.String id)
           
 Person getPersonByNumber(java.lang.String number)
           
 java.util.Iterator getPersonsByAttributes(java.util.Map attributes)
          Gets the Iterator of a List of Person objects that have the attributes contained in the attributes argument.
 Enterprise insertEnterprise(java.lang.String description)
           
 Person insertPerson(java.lang.String first_name, java.lang.String last_name)
           
protected  XmlRpcEnterprise receiveEnterprise(java.lang.Object enterprise_tmp)
           
protected  XmlRpcPerson receivePerson(java.lang.Object person_tmp)
           
 void update(java.util.Observable o, java.lang.Object arg)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTACTMANAGER_PERSON_INSERT

public static final java.lang.String CONTACTMANAGER_PERSON_INSERT
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_UPDATE

public static final java.lang.String CONTACTMANAGER_PERSON_UPDATE
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_DELETE

public static final java.lang.String CONTACTMANAGER_PERSON_DELETE
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_GET_BY_ID

public static final java.lang.String CONTACTMANAGER_PERSON_GET_BY_ID
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_GET_BY_NUMBER

public static final java.lang.String CONTACTMANAGER_PERSON_GET_BY_NUMBER
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_DELETE_BY_NUMBER

public static final java.lang.String CONTACTMANAGER_PERSON_DELETE_BY_NUMBER
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_FETCH

public static final java.lang.String CONTACTMANAGER_PERSON_FETCH
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_FETCH_IDS

public static final java.lang.String CONTACTMANAGER_PERSON_FETCH_IDS
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_FETCH_ENTERPRISES

public static final java.lang.String CONTACTMANAGER_PERSON_FETCH_ENTERPRISES
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_FETCH_JOBS

public static final java.lang.String CONTACTMANAGER_PERSON_FETCH_JOBS
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_FETCH_JOB_IDS

public static final java.lang.String CONTACTMANAGER_PERSON_FETCH_JOB_IDS
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_GET_ENTERPRISES

public static final java.lang.String CONTACTMANAGER_PERSON_GET_ENTERPRISES
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_INSERT_ENTERPRISE

public static final java.lang.String CONTACTMANAGER_PERSON_INSERT_ENTERPRISE
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_DELETE_ENTERPRISE

public static final java.lang.String CONTACTMANAGER_PERSON_DELETE_ENTERPRISE
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_GET_BY_ATTRIBUTES

public static final java.lang.String CONTACTMANAGER_PERSON_GET_BY_ATTRIBUTES
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_UPDATE_JOB

public static final java.lang.String CONTACTMANAGER_PERSON_UPDATE_JOB
See Also:
Constant Field Values

CONTACTMANAGER_PERSON_INSERT_JOB

public static final java.lang.String CONTACTMANAGER_PERSON_INSERT_JOB
See Also:
Constant Field Values

CONTACTMANAGER_ENTERPRISE_UPDATE

public static final java.lang.String CONTACTMANAGER_ENTERPRISE_UPDATE
See Also:
Constant Field Values

CONTACTMANAGER_ENTERPRISE_GET_BY_ID

public static final java.lang.String CONTACTMANAGER_ENTERPRISE_GET_BY_ID
See Also:
Constant Field Values

CONTACTMANAGER_ENTERPRISE_GET_BY_NUMBER

public static final java.lang.String CONTACTMANAGER_ENTERPRISE_GET_BY_NUMBER
See Also:
Constant Field Values

CONTACTMANAGER_ENTERPRISE_DELETE

public static final java.lang.String CONTACTMANAGER_ENTERPRISE_DELETE
See Also:
Constant Field Values

CONTACTMANAGER_ENTERPRISE_INSERT

public static final java.lang.String CONTACTMANAGER_ENTERPRISE_INSERT
See Also:
Constant Field Values

CONTACTMANAGER_ENTERPRISE_FETCH_IDS

public static final java.lang.String CONTACTMANAGER_ENTERPRISE_FETCH_IDS
See Also:
Constant Field Values

CONTACTMANAGER_ENTERPRISE_FETCH

public static final java.lang.String CONTACTMANAGER_ENTERPRISE_FETCH
See Also:
Constant Field Values

CONTACTMANAGER_ENTERPRISE_GET

public static final java.lang.String CONTACTMANAGER_ENTERPRISE_GET
See Also:
Constant Field Values

CONTACTMANAGER_ENTERPRISE_GET_PERSONS

public static final java.lang.String CONTACTMANAGER_ENTERPRISE_GET_PERSONS
See Also:
Constant Field Values

CONTACTMANAGER_ENTERPRISE_FETCH_PERSONS

public static final java.lang.String CONTACTMANAGER_ENTERPRISE_FETCH_PERSONS
See Also:
Constant Field Values

CONTACTMANAGER_ENTERPRISE_GET_PROJECTS

public static final java.lang.String CONTACTMANAGER_ENTERPRISE_GET_PROJECTS
See Also:
Constant Field Values

CONTACTMANAGER_ENTERPRISE_DELETE_PERSON

public static final java.lang.String CONTACTMANAGER_ENTERPRISE_DELETE_PERSON
See Also:
Constant Field Values

CONTACTMANAGER_ENTERPRISE_INSERT_PERSON

public static final java.lang.String CONTACTMANAGER_ENTERPRISE_INSERT_PERSON
See Also:
Constant Field Values

cached_persons_

protected java.util.Map cached_persons_

cached_enterprises_

protected java.util.Map cached_enterprises_

ogo

protected OpenGroupWare ogo

xmlcaller_

protected XmlRpcCaller xmlcaller_
Constructor Detail

XmlRpcContactManager

public XmlRpcContactManager(XmlRpcCaller caller,
                            OpenGroupWare ogo)
Method Detail

fetchContacts

public java.util.Iterator fetchContacts(FetchSpecification fspec)
                                 throws OgoException,
                                        ConnectionException
Description copied from interface: ContactManager
Fetches both Person and Enterprise records that match the FetchSpecification.

Specified by:
fetchContacts in interface ContactManager
Parameters:
fspec - A FetchSpecification describing the contacts to fetch.
Returns:
an Iterator giving access to the resulting Contacts or null if no matching records were found.
Throws:
OgoException
ConnectionException
See Also:
FetchSpecification

fetchPersons

public java.util.Iterator fetchPersons(FetchSpecification fspec)
                                throws OgoException,
                                       ConnectionException
Description copied from interface: ContactManager
Fetches only Person records that match the FetchSpecification.

Specified by:
fetchPersons in interface ContactManager
Parameters:
fspec - A FetchSpecification describing the contacts to fetch.
Returns:
an Iterator giving access to the resulting Person objects or null if no matching records were found.
Throws:
OgoException
ConnectionException
See Also:
FetchSpecification

fetchEnterprises

public java.util.Iterator fetchEnterprises(FetchSpecification fspec)
                                    throws OgoException,
                                           ConnectionException
Description copied from interface: ContactManager
Fetches only Enterprise records that match the FetchSpecification.

Specified by:
fetchEnterprises in interface ContactManager
Parameters:
fspec - A FetchSpecification describing the contacts to fetch.
Returns:
an Iterator giving access to the resulting Enterprise objects or null if no matching records were found.
Throws:
OgoException
ConnectionException
See Also:
FetchSpecification

commitUpdate

public void commitUpdate()

delete

public void delete(Enterprise enterprise)
            throws OgoException,
                   ConnectionException
Specified by:
delete in interface ContactManager
Throws:
OgoException
ConnectionException

delete

public void delete(Person person)
            throws OgoException,
                   ConnectionException
Specified by:
delete in interface ContactManager
Throws:
OgoException
ConnectionException

insertEnterprise

public Enterprise insertEnterprise(java.lang.String description)
                            throws OgoException,
                                   ConnectionException
Specified by:
insertEnterprise in interface ContactManager
Throws:
OgoException
ConnectionException

insertPerson

public Person insertPerson(java.lang.String first_name,
                           java.lang.String last_name)
                    throws OgoException,
                           ConnectionException
Specified by:
insertPerson in interface ContactManager
Throws:
OgoException
ConnectionException

fetchPersonMapId

public java.lang.Object fetchPersonMapId(int integer)
                                  throws OgoException,
                                         ConnectionException
Specified by:
fetchPersonMapId in interface ContactManager
Throws:
OgoException
ConnectionException

fetchEnterpriseMapId

public java.lang.Object fetchEnterpriseMapId(int integer)
                                      throws OgoException,
                                             ConnectionException
Specified by:
fetchEnterpriseMapId in interface ContactManager
Throws:
OgoException
ConnectionException

getEnterpriseById

public Enterprise getEnterpriseById(java.lang.String id)
                             throws OgoException,
                                    ConnectionException
Specified by:
getEnterpriseById in interface ContactManager
Throws:
OgoException
ConnectionException

getPersonById

public Person getPersonById(java.lang.String id)
                     throws OgoException,
                            ConnectionException
Specified by:
getPersonById in interface ContactManager
Throws:
OgoException
ConnectionException

getPersonByNumber

public Person getPersonByNumber(java.lang.String number)
                         throws OgoException,
                                ConnectionException
Specified by:
getPersonByNumber in interface ContactManager
Throws:
OgoException
ConnectionException

getPersonsByAttributes

public java.util.Iterator getPersonsByAttributes(java.util.Map attributes)
                                          throws OgoException,
                                                 ConnectionException
Description copied from interface: ContactManager
Gets the Iterator of a List of Person objects that have the attributes contained in the attributes argument.

Specified by:
getPersonsByAttributes in interface ContactManager
Parameters:
attributes - a Map with key= name of attribute (eg name,...) and value=String for the value of the attribute;
Throws:
OgoException
ConnectionException

getEnterprisesByAttributes

public java.util.Iterator getEnterprisesByAttributes(java.util.Map attributes)
                                              throws OgoException,
                                                     ConnectionException
Description copied from interface: ContactManager
Gets the Iterator of a List of Enterprise objects that have the attributes contained in the attributes argument.

Specified by:
getEnterprisesByAttributes in interface ContactManager
Parameters:
attributes - a Map with key= name of attribute (eg name,...) and value=String for the value of the attribute;
Throws:
OgoException
ConnectionException

getEnterprise

public Enterprise getEnterprise(int number)
                         throws OgoException,
                                ConnectionException
Specified by:
getEnterprise in interface ContactManager
Throws:
OgoException
ConnectionException

getEnterprise

public Enterprise getEnterprise(java.lang.String number)
                         throws OgoException,
                                ConnectionException
Specified by:
getEnterprise in interface ContactManager
Throws:
OgoException
ConnectionException

getEnterprises

public java.util.Iterator getEnterprises(java.util.Map attributes)
                                  throws OgoException,
                                         ConnectionException
Specified by:
getEnterprises in interface ContactManager
Throws:
OgoException
ConnectionException

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer

receivePerson

protected XmlRpcPerson receivePerson(java.lang.Object person_tmp)
                              throws OgoException,
                                     ConnectionException
Throws:
OgoException
ConnectionException

createNewPerson

protected XmlRpcPerson createNewPerson(java.util.Map content)
                                throws OgoException,
                                       ConnectionException
Throws:
OgoException
ConnectionException

getCachedPerson

protected XmlRpcPerson getCachedPerson(java.lang.Object obj)

receiveEnterprise

protected XmlRpcEnterprise receiveEnterprise(java.lang.Object enterprise_tmp)
                                      throws OgoException,
                                             ConnectionException
Throws:
OgoException
ConnectionException

createNewEnterprise

protected XmlRpcEnterprise createNewEnterprise(java.util.Map content)
                                        throws OgoException,
                                               ConnectionException
Throws:
OgoException
ConnectionException

getCachedEnterprise

protected XmlRpcEnterprise getCachedEnterprise(java.lang.Object obj)
                                        throws OgoException,
                                               ConnectionException
Throws:
OgoException
ConnectionException


Copyright © 2003 ogojogi Project, All Rights Reserved.