org.opengroupware.jogi.connect.xmlrpc
Class XmlRpcJobManager

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

public class XmlRpcJobManager
extends java.lang.Object
implements JobManager

Author:
Andreas Rath (teddius) , Werner Schuster (murphee)

Field Summary
protected  java.util.Map cached_jobs_
           
protected  XmlRpcCaller caller_
           
static java.lang.String JOB_MANAGER_JOB_GET_BY_ID
           
static java.lang.String JOB_MANAGER_JOB_GET_JOBS
           
static java.lang.String JOB_MANAGER_JOB_UPDATE
           
static java.lang.String JOB_MANAGER_PERSON_DELETE_JOB
           
static java.lang.String JOB_MANAGER_PERSON_FETCH_JOB_IDS
           
static java.lang.String JOB_MANAGER_PERSON_FETCH_JOBS
           
static java.lang.String JOB_MANAGER_PERSON_INSERT_JOB
           
static java.lang.String JOB_MANAGER_PERSON_UPDATE_JOB
           
protected  OpenGroupWare ogo_
           
 
Constructor Summary
XmlRpcJobManager(XmlRpcCaller caller, OpenGroupWare ogo)
           
 
Method Summary
protected  XmlRpcJob createNewJob(java.util.Map content)
           
 void delete(Person person, Job job)
           
 void delete(Person person, java.util.List list)
          Deletes a list of Jobs.
 void delete(Person person, java.lang.String id)
           
 void deleteJob(Person person, Job job)
           
 java.util.Iterator getAllJobs(Person person, java.util.Date startDate, java.util.Date endDate)
           
protected  XmlRpcJob getCachedJob(java.lang.Object obj)
          This method takes the return value of an XML-RPC call and looks up the object which represents this id in the cache.
 Job getJobById(java.lang.String job_id)
           
 java.util.Iterator getJobByIdList(java.util.List param)
           
 java.util.Iterator getJobs(java.lang.String[] job_ids)
          (non-Javadoc)
 Job insert(Person person, java.util.Date startDate, java.util.Date endDate, java.lang.String name)
           
 Job insert(Person person, Job job)
           
protected  XmlRpcJob receiveJob(java.lang.Object accTemp)
          This method takes the return value of an XML-RPC call, and updates the cached XmlRpcJob object or if it does not exist a newly created one initialised with the values returned from the XML-RPC call.
 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

JOB_MANAGER_JOB_UPDATE

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

JOB_MANAGER_JOB_GET_BY_ID

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

JOB_MANAGER_JOB_GET_JOBS

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

JOB_MANAGER_PERSON_FETCH_JOBS

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

JOB_MANAGER_PERSON_FETCH_JOB_IDS

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

JOB_MANAGER_PERSON_INSERT_JOB

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

JOB_MANAGER_PERSON_UPDATE_JOB

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

JOB_MANAGER_PERSON_DELETE_JOB

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

cached_jobs_

protected java.util.Map cached_jobs_

caller_

protected XmlRpcCaller caller_

ogo_

protected OpenGroupWare ogo_
Constructor Detail

XmlRpcJobManager

public XmlRpcJobManager(XmlRpcCaller caller,
                        OpenGroupWare ogo)
Method Detail

getJobs

public java.util.Iterator getJobs(java.lang.String[] job_ids)
                           throws OgoException,
                                  ConnectionException
(non-Javadoc)

Specified by:
getJobs in interface JobManager
Throws:
OgoException
ConnectionException
See Also:
JobManager.getJobs(java.lang.String[])

update

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

getJobById

public Job getJobById(java.lang.String job_id)
               throws OgoException,
                      ConnectionException
Throws:
OgoException
ConnectionException

receiveJob

protected XmlRpcJob receiveJob(java.lang.Object accTemp)
                        throws OgoException,
                               ConnectionException
This method takes the return value of an XML-RPC call, and updates the cached XmlRpcJob object or if it does not exist a newly created one initialised with the values returned from the XML-RPC call.

Parameters:
accTemp - The result of an XML-RPC Call.
Returns:
An updated or created instance of the XmlRpcJob object.
Throws:
OgoException
ConnectionException

getCachedJob

protected XmlRpcJob getCachedJob(java.lang.Object obj)
                          throws OgoException,
                                 ConnectionException
This method takes the return value of an XML-RPC call and looks up the object which represents this id in the cache. If the object exists in the cache the cached Object will be returned. If the object is not in the cache null will be returned.

Parameters:
obj - The result of an XML-RPC Call.
Returns:
An instance of an XmlRpcJob object or null if no object exists in the cache.
Throws:
OgoException
ConnectionException

createNewJob

protected XmlRpcJob createNewJob(java.util.Map content)
                          throws OgoException,
                                 ConnectionException
Throws:
OgoException
ConnectionException

getAllJobs

public java.util.Iterator getAllJobs(Person person,
                                     java.util.Date startDate,
                                     java.util.Date endDate)
                              throws OgoException,
                                     ConnectionException
Specified by:
getAllJobs in interface JobManager
Throws:
OgoException
ConnectionException

getJobByIdList

public java.util.Iterator getJobByIdList(java.util.List param)
                                  throws OgoException,
                                         ConnectionException
Specified by:
getJobByIdList in interface JobManager
Throws:
OgoException
ConnectionException

insert

public Job insert(Person person,
                  java.util.Date startDate,
                  java.util.Date endDate,
                  java.lang.String name)
           throws OgoException,
                  ConnectionException
Specified by:
insert in interface JobManager
Parameters:
person - the Person that this Job is associated with
startDate - the start date for this Job
endDate - the end date for this Job (can be null)
name - the name of this Job
Returns:
a Job object representing the inserted one
Throws:
OgoException
ConnectionException

insert

public Job insert(Person person,
                  Job job)
           throws OgoException,
                  ConnectionException
Specified by:
insert in interface JobManager
Throws:
OgoException
ConnectionException

delete

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

delete

public void delete(Person person,
                   java.lang.String id)
            throws OgoException,
                   ConnectionException
Specified by:
delete in interface JobManager
Throws:
OgoException
ConnectionException

delete

public void delete(Person person,
                   java.util.List list)
            throws java.lang.IllegalArgumentException,
                   OgoException,
                   ConnectionException
Description copied from interface: JobManager
Deletes a list of Jobs.

Specified by:
delete in interface JobManager
Parameters:
person - can be a List of Job objects or of Job Ids (as Strings).
list -
Throws:
java.lang.IllegalArgumentException
OgoException
ConnectionException

deleteJob

public void deleteJob(Person person,
                      Job job)
               throws OgoException,
                      ConnectionException
Throws:
OgoException
ConnectionException


Copyright © 2003 ogojogi Project, All Rights Reserved.