org.openmobileis.synchro.openmsp.client
Class OpenMSPDBSyncListener

java.lang.Object
  extended byorg.openmobileis.synchro.openmsp.client.DefaultOpenMSPSyncListener
      extended byorg.openmobileis.synchro.openmsp.client.OpenMSPDBSyncListener
All Implemented Interfaces:
OpenMSPSyncListener
Direct Known Subclasses:
OpenMSPFODBSyncListener

public abstract class OpenMSPDBSyncListener
extends DefaultOpenMSPSyncListener

Title: OpenMobileIS project source
Description:

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

Field Summary
protected  java.lang.String installPath
           
 
Fields inherited from class org.openmobileis.synchro.openmsp.client.DefaultOpenMSPSyncListener
ADD_ERROR_MESSAGE, DELETE_ERROR_MESSAGE, ITEM_ERROR_MESSAGE, SYNC_ERROR_MESSAGE, SYNC_UNAUTHORIZED_MESSAGE, UPDATE_ERROR_MESSAGE
 
Fields inherited from interface org.openmobileis.synchro.openmsp.client.OpenMSPSyncListener
SYNCHRO_FAILLED, SYNCHRO_OK
 
Constructor Summary
OpenMSPDBSyncListener()
           
 
Method Summary
protected abstract  java.lang.String[] getDBDataForAdd(java.lang.String pdaUID)
          return the data conforme to the disptacher create AbstractQueryManager method for specified pdaUID .
protected abstract  java.lang.String[] getDBDataForReplace(java.lang.String pdaUID)
          return the data conforme to the disptacher update AbstractQueryManager method for specified pdaUID .
protected abstract  ImportQueryManager getImportQueryManager()
          return the ImportQueryManager use to make synchro data import.
protected  java.lang.String getSendCommandMetaData()
           
protected  java.lang.String getServerUIDForAOUID(java.lang.String pdaUID)
          return the server uid for the specified pdaUID.
protected  byte[] getSyncDataForAtomicObjectUID(java.lang.String pdaUID, int action)
          return the data to add to the synchro command ADD OR REPLACE.
protected abstract  java.lang.String getSynchroTarget()
          return the target of the SYNC command use to synchronize listener data.
protected abstract  Credential getSyncroCredential()
          return the credential to use for data synchronization.
protected  void importCompletSynchroDatabaseFile(java.lang.String importFile)
          Call during complete synchronisation to dump the database with server data store in the specified file name.
protected  void manageReturnStatusLog(int statusCode, int cmlType, ContainerMessage container)
          notify when receiving a status commnand the status code, the CMLElement type of the send command and the container containing the command.
protected  void notifyMAPofUID(java.lang.String pdauid, java.lang.String serveruid)
           
 void notifySyncDataDone(java.lang.String pdaID, int actionType)
          Call when a client data modification (ActionDB) has been update on the server side.
 void receiveMapCommand(ContainerMessage mapContainer)
          Event sent when the sync manager receives MAP command openML messages from the server
 void receiveResultCommand(ContainerMessage resultContainer, ContainerMessage initialCommand)
          Event sent when the sync manager receives RESULT openML messages from the server
 void receiveStatusCommand(Status statusCommande, ContainerMessage initialContenaire)
          Event sent when the sync manager receives STATUS openML messages from the server
protected  void receiveSyncItem(Credential cred, Item item, long newSyncNumber)
          Call when the server answer SYNC command container contains a SYNC item.
protected  void removeServerUIDForAOUID(java.lang.String pdaUID)
          remove the pda uid associated server uid.
 void sendData(Message message)
          Event sent when the sync manager sends a openML message to the server The specified message is the message use to construct the synchro message This method fill the message with listener commande container.
 void startSync(Credential cred, SynchroDescriptor synchrodescriptor)
          Fire this event once a synchro is starting
 
Methods inherited from class org.openmobileis.synchro.openmsp.client.DefaultOpenMSPSyncListener
addCredentialToCommand, endSync, equals, getJournalLogRenderer, getSynchroStatus, hashCode, initListener, isSyncOK, notifySynchroFailure, receiveAddCommand, receiveDeleteCommand, receiveGetCommand, receiveReplaceCommand, receiveSyncCommand, setSynchroStatus
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.openmobileis.synchro.openmsp.client.OpenMSPSyncListener
getSyncName
 

Field Detail

installPath

protected java.lang.String installPath
Constructor Detail

OpenMSPDBSyncListener

public OpenMSPDBSyncListener()
Method Detail

startSync

public void startSync(Credential cred,
                      SynchroDescriptor synchrodescriptor)
               throws OpenMSPException
Description copied from class: DefaultOpenMSPSyncListener
Fire this event once a synchro is starting

Specified by:
startSync in interface OpenMSPSyncListener
Overrides:
startSync in class DefaultOpenMSPSyncListener
Throws:
OpenMSPException

sendData

public void sendData(Message message)
              throws OpenMSPException
Description copied from interface: OpenMSPSyncListener
Event sent when the sync manager sends a openML message to the server The specified message is the message use to construct the synchro message This method fill the message with listener commande container.

Throws:
OpenMSPException

receiveMapCommand

public void receiveMapCommand(ContainerMessage mapContainer)
                       throws OpenMSPException
Description copied from class: DefaultOpenMSPSyncListener
Event sent when the sync manager receives MAP command openML messages from the server

Specified by:
receiveMapCommand in interface OpenMSPSyncListener
Overrides:
receiveMapCommand in class DefaultOpenMSPSyncListener
Throws:
OpenMSPException

receiveResultCommand

public void receiveResultCommand(ContainerMessage resultContainer,
                                 ContainerMessage initialCommand)
                          throws OpenMSPException
Description copied from class: DefaultOpenMSPSyncListener
Event sent when the sync manager receives RESULT openML messages from the server

Specified by:
receiveResultCommand in interface OpenMSPSyncListener
Overrides:
receiveResultCommand in class DefaultOpenMSPSyncListener
Throws:
OpenMSPException

receiveStatusCommand

public void receiveStatusCommand(Status statusCommande,
                                 ContainerMessage initialContenaire)
                          throws OpenMSPException
Description copied from interface: OpenMSPSyncListener
Event sent when the sync manager receives STATUS openML messages from the server

Throws:
OpenMSPException

manageReturnStatusLog

protected void manageReturnStatusLog(int statusCode,
                                     int cmlType,
                                     ContainerMessage container)
notify when receiving a status commnand the status code, the CMLElement type of the send command and the container containing the command.


receiveSyncItem

protected void receiveSyncItem(Credential cred,
                               Item item,
                               long newSyncNumber)
Description copied from class: DefaultOpenMSPSyncListener
Call when the server answer SYNC command container contains a SYNC item. Extends this method to process SYNC item.

Overrides:
receiveSyncItem in class DefaultOpenMSPSyncListener

getSyncDataForAtomicObjectUID

protected byte[] getSyncDataForAtomicObjectUID(java.lang.String pdaUID,
                                               int action)
                                        throws OpenMSPException
return the data to add to the synchro command ADD OR REPLACE. The format must be the same has the one use on dispatcher size. the default implementation call getDBDataForAdd() getDBDataForReplace() repending on the action and encode the result

Throws:
OpenMSPException

getSendCommandMetaData

protected java.lang.String getSendCommandMetaData()
                                           throws OpenMSPException
Throws:
OpenMSPException

getServerUIDForAOUID

protected java.lang.String getServerUIDForAOUID(java.lang.String pdaUID)
return the server uid for the specified pdaUID. Atomiv Object uid can be different on the server side and on the pda size. This method return the server uid use on server side to reference the pda uid specified. return null if not found.


notifySyncDataDone

public void notifySyncDataDone(java.lang.String pdaID,
                               int actionType)
                        throws OpenMSPException
Call when a client data modification (ActionDB) has been update on the server side. The actionType is defined by the class ActionDB.

Parameters:
pdaID - : Id of the object updated on the server side.
actionType - ActionDB modification type
Throws:
OpenMSPException

notifyMAPofUID

protected void notifyMAPofUID(java.lang.String pdauid,
                              java.lang.String serveruid)
                       throws OpenMSPException
Throws:
OpenMSPException

removeServerUIDForAOUID

protected void removeServerUIDForAOUID(java.lang.String pdaUID)
                                throws OpenMSPException
remove the pda uid associated server uid. this method is call when a delete commande from the PDA is has been done to the server. delete AO server id must be deleted to the pda too.

Throws:
OpenMSPException

importCompletSynchroDatabaseFile

protected void importCompletSynchroDatabaseFile(java.lang.String importFile)
                                         throws DatabaseException
Call during complete synchronisation to dump the database with server data store in the specified file name.

Parameters:
importFile - : file containing server dump data file.
Throws:
DatabaseException

getDBDataForAdd

protected abstract java.lang.String[] getDBDataForAdd(java.lang.String pdaUID)
                                               throws OpenMSPException
return the data conforme to the disptacher create AbstractQueryManager method for specified pdaUID . Return null if no data found

Throws:
OpenMSPException

getDBDataForReplace

protected abstract java.lang.String[] getDBDataForReplace(java.lang.String pdaUID)
                                                   throws OpenMSPException
return the data conforme to the disptacher update AbstractQueryManager method for specified pdaUID . Return null if no data found

Throws:
OpenMSPException

getSynchroTarget

protected abstract java.lang.String getSynchroTarget()
return the target of the SYNC command use to synchronize listener data.


getSyncroCredential

protected abstract Credential getSyncroCredential()
return the credential to use for data synchronization. If no need return null.


getImportQueryManager

protected abstract ImportQueryManager getImportQueryManager()
return the ImportQueryManager use to make synchro data import.



Copyright 2006 OpenMobileIS. All Rights Reserved.