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 activateListenerByName(java.lang.String listenerName)
          Activate the specified listener name.
 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 clearListeners()
           
 void doSynchro(Credential cred, SynchroDescriptor descriptor)
           
 Array getAllListeners()
          Return an Array of all the listeners contains
 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 inactivateListenerByName(java.lang.String listenerName)
          Inactivate the specified listener name.
 void notifyFailure(java.lang.String listernerName)
           
 void registerSynchroListenerAddNotifier(SynchroListenerAddNotifier listener)
          register a listener that will be notified when a synchrolistener is added.
 boolean removeListenerByName(java.lang.String listenerName)
          Remove the listener with the specified name.
 void restartSynchro()
          restart the synchro when the current synchro finish.
 void setGlobalSynchroStatut(int status)
           
 void setOpenMSPSynchroProcessListener(OpenMSPSynchroProcessListener listener)
           
 void waitSynchroEnd()
          This method block until the synchro end.
 
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()

setOpenMSPSynchroProcessListener

public void setOpenMSPSynchroProcessListener(OpenMSPSynchroProcessListener listener)

clearListeners

public void clearListeners()

getProcessorName

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

notifyFailure

public void notifyFailure(java.lang.String listernerName)

getAllListeners

public Array getAllListeners()
Return an Array of all the listeners contains

Returns:
array of listeners Added by Manuel GOMEZ

getListenerByName

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

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

removeListenerByName

public boolean removeListenerByName(java.lang.String listenerName)
Remove the listener with the specified name. It remove all dependent listener too. Return a boolean to inform the succed or not of the remove operation

Parameters:
listenerName -
Returns:
succed or not boolean

inactivateListenerByName

public void inactivateListenerByName(java.lang.String listenerName)
Inactivate the specified listener name. Depend listener are not Inactivate

Parameters:
listenerName -
Returns:
succed or not boolean

activateListenerByName

public void activateListenerByName(java.lang.String listenerName)
Activate the specified listener name. Depend listener are not Activate if previously inactivate

Parameters:
listenerName -
Returns:
succed or not boolean

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:

restartSynchro

public void restartSynchro()
restart the synchro when the current synchro finish. Only effectiveif call during a synchronization.


waitSynchroEnd

public void waitSynchroEnd()
This method block until the synchro end. Return immediatly if the synchro is not started.


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()

setGlobalSynchroStatut

public void setGlobalSynchroStatut(int status)


Copyright 2006 OpenMobileIS. All Rights Reserved.