org.openmobileis.modules.common.log.terminal
Class LogsSynchroListener

java.lang.Object
  extended byorg.openmobileis.modules.common.log.terminal.LogsSynchroListener
All Implemented Interfaces:
OpenMSPSyncListener

public class LogsSynchroListener
extends java.lang.Object
implements OpenMSPSyncListener

Title: OpenMobileIS project source
Description: mail synchro listeners

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

Field Summary
static java.lang.String LOG_LISTENER_NAME
           
 
Fields inherited from interface org.openmobileis.synchro.openmsp.client.OpenMSPSyncListener
SYNCHRO_FAILLED, SYNCHRO_OK
 
Constructor Summary
LogsSynchroListener()
           
 
Method Summary
 void endSync()
          Fire this event once the current synchro is ended
 int getErrorStatus()
           
 int getSynchroStatus()
          Return the synchro status of the listener.
 java.lang.String getSyncName()
          Return the name used to identiy the of the listener in the synchro processus.
 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
 void receiveGetCommand(Credential cred, ContainerMessage replaceContainer, long newSyncNumber)
          Call when the server answer container contains a GET command.
 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 initialCommand)
          Event sent when the sync manager receives STATUS 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
 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 setSynchroStatus(int status)
           
 void startSync(Credential cred, SynchroDescriptor synchrodescriptor)
          Fire this event once a synchro is starting
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_LISTENER_NAME

public static final java.lang.String LOG_LISTENER_NAME
See Also:
Constant Field Values
Constructor Detail

LogsSynchroListener

public LogsSynchroListener()
Method Detail

initListener

public void initListener()
                  throws OpenMSPException
Description copied from interface: OpenMSPSyncListener
Call during listener registering. The init occurs before the synchronisation. If an exception is throws the listener is not registered.

Specified by:
initListener in interface OpenMSPSyncListener
Throws:
OpenMSPException

setSynchroStatus

public void setSynchroStatus(int status)

getSynchroStatus

public int getSynchroStatus()
Description copied from interface: OpenMSPSyncListener
Return the synchro status of the listener. The return value is defined by the OpenMSP Status class.

Specified by:
getSynchroStatus in interface OpenMSPSyncListener
See Also:
Status

isSyncOK

public boolean isSyncOK()
Description copied from interface: OpenMSPSyncListener
return true if the synchronisation is OK for the listener.

Specified by:
isSyncOK in interface OpenMSPSyncListener

notifySynchroFailure

public void notifySynchroFailure()
Description copied from interface: OpenMSPSyncListener
The listener is called if the syncML command processing failed

Specified by:
notifySynchroFailure in interface OpenMSPSyncListener

receiveStatusCommand

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

Specified by:
receiveStatusCommand in interface OpenMSPSyncListener
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.

Specified by:
sendData in interface OpenMSPSyncListener
Throws:
OpenMSPException

receiveSyncCommand

public void receiveSyncCommand(ContainerMessage syncContainer,
                               long newSyncNumber)
                        throws OpenMSPException
Event sent when the sync manager receives Sync command openML messages from the server

Specified by:
receiveSyncCommand in interface OpenMSPSyncListener
Throws:
OpenMSPException

receiveMapCommand

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

Specified by:
receiveMapCommand in interface OpenMSPSyncListener
Throws:
OpenMSPException

receiveResultCommand

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

Specified by:
receiveResultCommand in interface OpenMSPSyncListener
Throws:
OpenMSPException

receiveGetCommand

public void receiveGetCommand(Credential cred,
                              ContainerMessage replaceContainer,
                              long newSyncNumber)
                       throws OpenMSPException
Description copied from interface: OpenMSPSyncListener
Call when the server answer container contains a GET command. Extends this method to process GET command.

Specified by:
receiveGetCommand in interface OpenMSPSyncListener
Throws:
OpenMSPException

getSyncName

public java.lang.String getSyncName()
Description copied from interface: OpenMSPSyncListener
Return the name used to identiy the of the listener in the synchro processus. This name correspond to the source in the OpenMS protocol.

Specified by:
getSyncName in interface OpenMSPSyncListener

startSync

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

Specified by:
startSync in interface OpenMSPSyncListener
Throws:
OpenMSPException

endSync

public void endSync()
Description copied from interface: OpenMSPSyncListener
Fire this event once the current synchro is ended

Specified by:
endSync in interface OpenMSPSyncListener

getErrorStatus

public int getErrorStatus()
Returns:


Copyright 2006 OpenMobileIS. All Rights Reserved.