org.openmobileis.synchro.openmsp.client
Class OpenMSPSynchroManager

java.lang.Object
  extended byorg.openmobileis.synchro.openmsp.client.OpenMSPSynchroManager
All Implemented Interfaces:
SynchroProcessor

public class OpenMSPSynchroManager
extends java.lang.Object
implements SynchroProcessor

Title: OpenMobileIS project source
Description: Default SynchroManager for OpenMSP protocol.

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

Field Summary
static java.lang.String OPENMSPPROCESSORNAME
           
 
Method Summary
 void addListener(OpenMSPSyncListener listener, java.lang.String[] depends)
          register a new listener and its depends that will participate to the synchro.
 void addModuleListener(OpenMSPSyncListener listener, java.lang.String[] depends)
          register a new listener and its depends that will participate to the module synchro.
 void doSynchro(Credential cred, SynchroDescriptor descriptor)
           
 int getGlobalSynchroStatut()
           
 java.lang.String getLastSynchroLogin()
           
 OpenMSPSyncListener getListenerByName(java.lang.String listenerName)
          Return the registered listener with specified name.
static OpenMSPSynchroManager getManager()
           
 OpenMSPSyncListener getModuleListenerByName(java.lang.String listenerName)
          Return the registered module listener with specified name.
 java.lang.String getProcessorName()
           
 java.lang.String getSynchroUserAgent(SynchroDescriptor descriptor)
          return the user agent to use with synchronisation.
 void notifyFailure(java.lang.String listernerName)
           
 void registerSynchroListenerAddNotifier(SynchroListenerAddNotifier listener)
          register a listener that will be notified when a synchrolistener is added.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OPENMSPPROCESSORNAME

public static final java.lang.String OPENMSPPROCESSORNAME
See Also:
Constant Field Values
Method Detail

getManager

public static OpenMSPSynchroManager getManager()

getProcessorName

public java.lang.String getProcessorName()
Specified by:
getProcessorName in interface SynchroProcessor

notifyFailure

public void notifyFailure(java.lang.String listernerName)

getListenerByName

public OpenMSPSyncListener getListenerByName(java.lang.String listenerName)
Return the registered listener with specified name.

Parameters:
listenerName -
Returns:
registered listener with specified name.

getModuleListenerByName

public OpenMSPSyncListener getModuleListenerByName(java.lang.String listenerName)
Return the registered module listener with specified name. Module listener participate to module synchro Module synchro is the synchro of module specific files to manage module update.

Parameters:
listenerName -
Returns:

doSynchro

public void doSynchro(Credential cred,
                      SynchroDescriptor descriptor)
               throws SynchroException
Specified by:
doSynchro in interface SynchroProcessor
Throws:
SynchroException

registerSynchroListenerAddNotifier

public void registerSynchroListenerAddNotifier(SynchroListenerAddNotifier listener)
register a listener that will be notified when a synchrolistener is added.


addListener

public void addListener(OpenMSPSyncListener listener,
                        java.lang.String[] depends)
register a new listener and its depends that will participate to the synchro. Listener's depends are an array of listener name that must be synchronized before the new listener. There is no specific order to register the listener and its dependance. If the SynchroListenerAddNotifier is registered the listener is registered only if the isBlocking() call return true. In other case nothing is done. The listener initListener() method is call before in all case.

Parameters:
listener - : listener to register
depends - : list of listener name

addModuleListener

public void addModuleListener(OpenMSPSyncListener listener,
                              java.lang.String[] depends)
register a new listener and its depends that will participate to the module synchro. Module synchro is the synchro of module specific files to manage module update. Listener's depends are an array of listener name that must be synchronized before the new listener. Thier is no specific order to register the listener and its dependance.

Parameters:
listener - : listener to register
depends - : list of listener name

getLastSynchroLogin

public java.lang.String getLastSynchroLogin()

getSynchroUserAgent

public java.lang.String getSynchroUserAgent(SynchroDescriptor descriptor)
return the user agent to use with synchronisation. The user agent can be defined with the property org.openmobileis.synchro.direct.useragent. or if not set, it's constructed with plateform information. default user agent : OpenMSPPlug-.-[]-- The synchro type is defined with the property OpenMSPsynchrotype of the descriptor.

Returns:

getGlobalSynchroStatut

public int getGlobalSynchroStatut()


Copyright 2006 OpenMobileIS. All Rights Reserved.