|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openmobileis.synchro.openmsp.client.DefaultOpenMSPSyncListener
Title: OpenMobileIS project source
Description: Default Synchro listener that handle OpenMS protocol for synchronisation.
Provide helper classes to facilitate the use of OpenMS protocol.
The synchroStatus is made persistent by using the ServicePropertiesManager.
Field Summary | |
protected static java.lang.String |
ADD_ERROR_MESSAGE
|
protected static java.lang.String |
DELETE_ERROR_MESSAGE
|
protected static java.lang.String |
ITEM_ERROR_MESSAGE
|
protected static java.lang.String |
SYNC_ERROR_MESSAGE
|
protected static java.lang.String |
SYNC_UNAUTHORIZED_MESSAGE
|
protected static java.lang.String |
UPDATE_ERROR_MESSAGE
|
Fields inherited from interface org.openmobileis.synchro.openmsp.client.OpenMSPSyncListener |
SYNCHRO_FAILLED, SYNCHRO_OK |
Constructor Summary | |
DefaultOpenMSPSyncListener()
|
Method Summary | |
protected static void |
addCredentialToCommand(Credential cred,
RequestCommand command)
Utility method that add the synchro credential to a RequestCommand. |
void |
endSync()
Fire this event once the current synchro is ended |
boolean |
equals(java.lang.Object obj)
|
protected JournalLogRenderer |
getJournalLogRenderer()
|
int |
getSynchroStatus()
Return the synchro status of the listener. |
int |
hashCode()
|
void |
initListener()
Call during listener registering. |
boolean |
isSyncOK()
return true if the synchronisation is OK for the listener. |
void |
notifySynchroFailure()
The listener is called if the syncML command processing failed |
protected void |
receiveAddCommand(Credential cred,
ContainerMessage addContainer,
long newSyncNumber)
Call when the server answer SYNC command container contains a ADD item. |
protected void |
receiveDeleteCommand(Credential cred,
ContainerMessage deleteContainer,
long newSyncNumber)
Call when the server answer SYNC command container contains a DELETE item. |
void |
receiveGetCommand(Credential cred,
ContainerMessage replaceContainer,
long newSyncNumber)
Call when the server answer SYNC command container contains a GET item. |
void |
receiveMapCommand(ContainerMessage mapContainer)
Event sent when the sync manager receives MAP command openML messages from the server |
protected void |
receiveReplaceCommand(Credential cred,
ContainerMessage replaceContainer,
long newSyncNumber)
Call when the server answer SYNC command container contains a REPLACE item. |
void |
receiveResultCommand(ContainerMessage resultContainer,
ContainerMessage initialCommand)
Event sent when the sync manager receives RESULT openML messages from the server |
void |
receiveSyncCommand(ContainerMessage syncContainer,
long newSyncNumber)
Event sent when the sync manager receives Sync command 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 |
setSynchroStatus(int status)
update the synchro status if the specified status is less than current synchro status (more serious status) |
void |
startSync(Credential cred,
SynchroDescriptor synchrodescriptor)
Fire this event once a synchro is starting |
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, receiveStatusCommand, sendData |
Field Detail |
protected static java.lang.String ADD_ERROR_MESSAGE
protected static java.lang.String UPDATE_ERROR_MESSAGE
protected static java.lang.String DELETE_ERROR_MESSAGE
protected static java.lang.String ITEM_ERROR_MESSAGE
protected static java.lang.String SYNC_ERROR_MESSAGE
protected static java.lang.String SYNC_UNAUTHORIZED_MESSAGE
Constructor Detail |
public DefaultOpenMSPSyncListener()
Method Detail |
public boolean isSyncOK()
OpenMSPSyncListener
isSyncOK
in interface OpenMSPSyncListener
public void initListener() throws OpenMSPException
OpenMSPSyncListener
initListener
in interface OpenMSPSyncListener
OpenMSPException
public void startSync(Credential cred, SynchroDescriptor synchrodescriptor) throws OpenMSPException
startSync
in interface OpenMSPSyncListener
OpenMSPException
public void endSync() throws OpenMSPException
OpenMSPSyncListener
endSync
in interface OpenMSPSyncListener
OpenMSPException
public int getSynchroStatus()
getSynchroStatus
in interface OpenMSPSyncListener
Status
public void notifySynchroFailure()
OpenMSPSyncListener
notifySynchroFailure
in interface OpenMSPSyncListener
public boolean equals(java.lang.Object obj)
public int hashCode()
public void receiveSyncCommand(ContainerMessage syncContainer, long newSyncNumber) throws OpenMSPException
receiveSyncCommand
in interface OpenMSPSyncListener
OpenMSPException
protected static void addCredentialToCommand(Credential cred, RequestCommand command)
protected void setSynchroStatus(int status)
protected JournalLogRenderer getJournalLogRenderer()
protected void receiveAddCommand(Credential cred, ContainerMessage addContainer, long newSyncNumber) throws OpenMSPException
OpenMSPException
protected void receiveSyncItem(Credential cred, Item item, long newSyncNumber) throws OpenMSPException
OpenMSPException
protected void receiveDeleteCommand(Credential cred, ContainerMessage deleteContainer, long newSyncNumber) throws OpenMSPException
OpenMSPException
protected void receiveReplaceCommand(Credential cred, ContainerMessage replaceContainer, long newSyncNumber) throws OpenMSPException
OpenMSPException
public void receiveGetCommand(Credential cred, ContainerMessage replaceContainer, long newSyncNumber) throws OpenMSPException
receiveGetCommand
in interface OpenMSPSyncListener
OpenMSPException
public void receiveMapCommand(ContainerMessage mapContainer) throws OpenMSPException
receiveMapCommand
in interface OpenMSPSyncListener
OpenMSPException
public void receiveResultCommand(ContainerMessage resultContainer, ContainerMessage initialCommand) throws OpenMSPException
receiveResultCommand
in interface OpenMSPSyncListener
OpenMSPException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |