Inheritance diagram for org.openmobileis.database.fastobjectdb.db.test.TestFODBSyncTarget:
Definition at line 50 of file TestFODBSyncTarget.java.
Public Member Functions | |
TestFODBSyncTarget () | |
String | getCollectionName () |
| |
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. | |
Array | getAllCollectionObject () throws OpenMSPException |
It's call when a complete synchronisation is done to fill the terminal database with all object. | |
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. | |
SynchroAtomicObject[] | getAllModifiedAtomicObjectSince (long syncnumber) 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 org.openmobileis.database.fastobjectdb.db.test.TestFODBSyncTarget.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.
metadata |
OpenMSPException |
Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.
Definition at line 68 of file TestFODBSyncTarget.java.
Object org.openmobileis.database.fastobjectdb.db.test.TestFODBSyncTarget.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.
Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.
Definition at line 75 of file TestFODBSyncTarget.java.
References org.odbms.Query.constrain(), org.odbms.Query.descend(), org.odbms.Constraint.equal(), org.odbms.Query.execute(), org.odbms.ObjectSet.hasNext(), and org.odbms.ObjectSet.next().
Array org.openmobileis.database.fastobjectdb.db.test.TestFODBSyncTarget.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.
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 91 of file TestFODBSyncTarget.java.
References org.odbms.Query.constrain(), org.odbms.Query.descend(), and org.odbms.Query.execute().
void org.openmobileis.database.fastobjectdb.db.test.TestFODBSyncTarget.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.
obj | is the instance of the modified object. |
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 107 of file TestFODBSyncTarget.java.
References org.openmobileis.database.fastobjectdb.db.test.TestData.getKey().
void org.openmobileis.database.fastobjectdb.db.test.TestFODBSyncTarget.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.
id | is the identifiant of the deleted object. |
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 124 of file TestFODBSyncTarget.java.
SynchroConflicResolver org.openmobileis.database.fastobjectdb.db.test.TestFODBSyncTarget.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.
org.openmobileis.synchro.algo.replication.AlwaysUpdateServerSynchroConflicResolver
Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.
Definition at line 135 of file TestFODBSyncTarget.java.
SynchroAtomicObject [] org.openmobileis.database.fastobjectdb.db.test.TestFODBSyncTarget.getAllModifiedAtomicObjectSince | ( | long | syncnumber | ) | 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 142 of file TestFODBSyncTarget.java.
References org.openmobileis.synchro.algo.replication.SynchroAtomicObject.setModificationType(), and org.openmobileis.database.fastobjectdb.db.test.TestData.setToModify().
int org.openmobileis.database.fastobjectdb.db.test.TestFODBSyncTarget.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 201 of file TestFODBSyncTarget.java.
void org.openmobileis.database.fastobjectdb.db.test.TestFODBSyncTarget.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.
db | the database collection (thedb contains only the synchronized collection). |
Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.
Definition at line 208 of file TestFODBSyncTarget.java.
void org.openmobileis.database.fastobjectdb.db.test.TestFODBSyncTarget.connect | ( | Credential | cred | ) | throws UserNotFoundException, ServiceException |
call at the beginning of the collection synchronisation.
cred | : synchronisation credential |
UserNotFoundException | ||
ServiceException |
Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.
Definition at line 214 of file TestFODBSyncTarget.java.
void org.openmobileis.database.fastobjectdb.db.test.TestFODBSyncTarget.disconnect | ( | ) |
call at the end of the collection synchronisation.
cred | : synchronisation credential |
UserNotFoundException | ||
ServiceException |
Implements org.openmobileis.database.fastobjectdb.synchro.server.FODBSyncTarget.
Definition at line 220 of file TestFODBSyncTarget.java.