org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget Class Reference

Inheritance diagram for org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget:

org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget List of all members.

Detailed Description

Title: OpenMobileIS Project Description:.

Author:
Philippe Delrieu
Since:
JDK 1.1
Version:
1.0.

Definition at line 59 of file JDBCTerminalUserFODBSyncTarget.java.

Public Member Functions

 JDBCTerminalUserFODBSyncTarget (TerminalUserJDBCQuery q)
 Constructor for TerminalUserManager.
String getCollectionName ()
 
Returns:
the name to the terminal FODB collection.

void setSendSynchroMetaData (Object metadata) throws OpenMSPException
 Synchro meta data added to the synchro on the terminal side are given be the synchro process.
Object getCollectionObjectWithId (String id) throws OpenMSPException
 It is use by the synchro service to get an object from the database when it has to be updated on the terminal.
void updateCollectionObject (Object obj) throws OpenMSPException
 Implement the update part of the database.
void deleteCollectionObject (String id) throws OpenMSPException
 Implement the delete part of the database.
SynchroConflicResolver getConflicResolver ()
 When a conflic is detected, the synchro service use this conflic resolver to determine the action to do.
Array getAllCollectionObject () throws OpenMSPException
 It's call when a complete synchronisation is done to fill the terminal database with all object.
String getCollectionObjectId (Object obj)
SynchroAtomicObject[] getAllModifiedAtomicObjectSince (long date) throws OpenMSPException
 Return all atomic object uid modified since specified syncnumber.
int getUpdateMaxNbRow ()
 Return the max number of row that update file can contains If more than max row must be updated on the PDA, a complete synchronisation will be started, the database file will be send.
void updateSynchroDB (FastObjectDB db) throws OpenMSPException
 call by synchronisation service during complete synchronisation to update the generated db collection.
void connect (Credential cred) throws UserNotFoundException, ServiceException
 call at the beginning of the collection synchronisation.
void disconnect ()
 call at the end of the collection synchronisation.
void notifyTerminalUserUpdate (TerminalUser rep) throws SynchroException
void notifyTerminalUserdelete (String repId) throws SynchroException

Protected Attributes

TerminalUserJDBCQuery query


Member Function Documentation

void org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.setSendSynchroMetaData ( Object  metadata  )  throws OpenMSPException

Synchro meta data added to the synchro on the terminal side are given be the synchro process.

This method is call before all other synchro method.

Parameters:
metadata 
Exceptions:
OpenMSPException 

Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.

Definition at line 85 of file JDBCTerminalUserFODBSyncTarget.java.

Object org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.getCollectionObjectWithId ( String  id  )  throws OpenMSPException

It is use by the synchro service to get an object from the database when it has to be updated on the terminal.

Returns:
the collection object with the specified ID.

Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.

Definition at line 92 of file JDBCTerminalUserFODBSyncTarget.java.

References org.openmobileis.modules.common.database.jdbc.TerminalUserJDBCQuery.convertResultSetToTerminalUser(), org.openmobileis.common.util.database.ManagerDB.garbageOpenedConnection(), org.openmobileis.modules.common.database.jdbc.TerminalUserJDBCQuery.getDbManager(), org.openmobileis.modules.common.database.jdbc.TerminalUserJDBCQuery.getTerminalUser(), org.openmobileis.modules.common.data.TerminalUser.getTerminalUserId(), org.openmobileis.common.context.SessionContext.getUserId(), org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.query, and org.openmobileis.modules.common.data.TerminalUser.setInstallTerminalUser().

Referenced by org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.deleteCollectionObject(), and org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.updateCollectionObject().

void org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.updateCollectionObject ( Object  obj  )  throws OpenMSPException

Implement the update part of the database.

Call by the synchro service when a object has been modified on the terminal. There's only an update method, no insert because on the server side we can't know if it's an update on an insert. Because of synchronisation problems, a created object on the terminal can be synchronized two time. So for each modified object on the terminal you have to validate if it's already exist.

Parameters:
obj is the instance of the modified object.
Exceptions:
OpenMSPException : throws when there is a database update problem. The synchro collection will be in error in the terminal synchro journal. The object will come back in the next synchronisation.

Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.

Definition at line 117 of file JDBCTerminalUserFODBSyncTarget.java.

References org.openmobileis.common.util.database.ManagerDB.garbageOpenedConnection(), org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.getCollectionObjectWithId(), org.openmobileis.modules.common.database.jdbc.TerminalUserJDBCQuery.getDbManager(), org.openmobileis.modules.common.database.jdbc.TerminalUserJDBCQuery.getInsertParamFromTerminalUser(), org.openmobileis.modules.common.data.TerminalUser.getTerminalUserId(), org.openmobileis.modules.common.database.jdbc.TerminalUserJDBCQuery.getUpdateParamFromTerminalUser(), org.openmobileis.modules.common.database.jdbc.TerminalUserJDBCQuery.insertTerminalUser(), org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.query, and org.openmobileis.modules.common.database.jdbc.TerminalUserJDBCQuery.updateTerminalUser().

void org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.deleteCollectionObject ( String  id  )  throws OpenMSPException

Implement the delete part of the database.

Call by the synchro service when a object has been deleted on the terminal.

Parameters:
id is the identifiant of the deleted object.
Exceptions:
OpenMSPException :throws when there is a database delete problem. The synchro collection will be in error in the terminal synchro journal. The id will come back in the next synchronisation.

Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.

Definition at line 140 of file JDBCTerminalUserFODBSyncTarget.java.

References org.openmobileis.modules.common.database.jdbc.TerminalUserJDBCQuery.deleteTerminalUser(), org.openmobileis.common.util.database.ManagerDB.garbageOpenedConnection(), org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.getCollectionObjectWithId(), org.openmobileis.modules.common.database.jdbc.TerminalUserJDBCQuery.getDbManager(), and org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.query.

SynchroConflicResolver org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.getConflicResolver (  ) 

When a conflic is detected, the synchro service use this conflic resolver to determine the action to do.

We provide default conflic resolver behaviours.

See also:
org.openmobileis.synchro.algo.replication.AlwaysUpdateClientSynchroConflicResolver

org.openmobileis.synchro.algo.replication.AlwaysUpdateServerSynchroConflicResolver

Returns:
Return the conflic resolver use to manage synchro conflic.

Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.

Definition at line 161 of file JDBCTerminalUserFODBSyncTarget.java.

Array org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.getAllCollectionObject (  )  throws OpenMSPException

It's call when a complete synchronisation is done to fill the terminal database with all object.

If no complete synchronisation can occurs (getUpdateMaxNbRow() always return -1), the method is never call. So no implementation is needed. Complete synchronisation is a convenient way to optimize the terminal synchronisation. some time it's make less time to generate the Terminal complete collection on the server side than to synchronize all modifications.

Returns:
Return all the object of the collection for the user that initiate the collection.
Exceptions:
OpenMSPException : throws when there is a problem to invalidate the synchronisation. The synchro collection will be in error in the terminal synchro journal.

Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.

Definition at line 168 of file JDBCTerminalUserFODBSyncTarget.java.

References org.openmobileis.common.util.collection.Array.add(), org.openmobileis.modules.common.database.jdbc.TerminalUserJDBCQuery.convertResultSetToTerminalUser(), org.openmobileis.common.util.database.ManagerDB.garbageOpenedConnection(), org.openmobileis.modules.common.database.jdbc.TerminalUserJDBCQuery.getAllTerminalUsers(), org.openmobileis.modules.common.database.jdbc.TerminalUserJDBCQuery.getDbManager(), org.openmobileis.common.context.SessionContext.getUserId(), org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.query, and org.openmobileis.modules.common.data.TerminalUser.setInstallTerminalUser().

SynchroAtomicObject [] org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.getAllModifiedAtomicObjectSince ( long  date  )  throws OpenMSPException

Return all atomic object uid modified since specified syncnumber.

Syncnumber is a number incremented for each synchro request. It can be converted to a timestamp with the SyncNumberManager. It's preferable to use number increment for synchronisation than timestamp to avoid desynchronized clock problem. Terminal and server can be desynchronized at the system cloc level of a few second. A synchronisation can elapse less than a few second. This can leads to synchronisation problem that can be difficult to track.

Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.

Definition at line 200 of file JDBCTerminalUserFODBSyncTarget.java.

int org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.getUpdateMaxNbRow (  ) 

Return the max number of row that update file can contains If more than max row must be updated on the PDA, a complete synchronisation will be started, the database file will be send.

If return -1 (default implementation) max row in not taken into account (ie always update file)

Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.

Definition at line 210 of file JDBCTerminalUserFODBSyncTarget.java.

void org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.updateSynchroDB ( FastObjectDB  db  )  throws OpenMSPException

call by synchronisation service during complete synchronisation to update the generated db collection.

Use to modifiy db objects before the db files are send to the Terminal. Empty is nothing has to ne done.

Parameters:
db the database collection (thedb contains only the synchronized collection).

Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.

Definition at line 217 of file JDBCTerminalUserFODBSyncTarget.java.

void org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.connect ( Credential  cred  )  throws UserNotFoundException, ServiceException

call at the beginning of the collection synchronisation.

Parameters:
cred : synchronisation credential
Exceptions:
UserNotFoundException 
ServiceException 

Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.

Definition at line 223 of file JDBCTerminalUserFODBSyncTarget.java.

void org.openmobileis.modules.common.database.jdbc.JDBCTerminalUserFODBSyncTarget.disconnect (  ) 

call at the end of the collection synchronisation.

Parameters:
cred : synchronisation credential
Exceptions:
UserNotFoundException 
ServiceException 

Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.

Definition at line 230 of file JDBCTerminalUserFODBSyncTarget.java.


The documentation for this class was generated from the following file:
Generated on Mon Dec 4 11:03:40 2006 for OpenMobileIS by  doxygen 1.5.1-p1