org.openmobileis.bundle.update.terminal
Class FullAppUpdateListener

java.lang.Object
  extended byorg.openmobileis.synchro.openmsp.client.DefaultOpenMSPSyncListener
      extended byorg.openmobileis.bundle.update.terminal.FullAppUpdateListener
All Implemented Interfaces:
OpenMSPSyncListener

public final class FullAppUpdateListener
extends DefaultOpenMSPSyncListener

Synchro listener use to synchronize a jar file from the server. the jar is unzipped from the user.dir root directory and erase all existing file. The jar is stored in the user.dir/temp directory and named APPLICATION_JAR_FILENAME="fullapplication.jar" Some attrinute of the jar manifest can be use to define synchro behaviours : - OpenMIS-AppUpdate-Version : define the version of the jar. If the server side version is different from the terminal version the server version is synchronized on the device. To avoid synchronisatoin after the application installation put an empty jar on the device with a manifest with the server version as the server or put no jar on the server side. After installation, the jar is deleted but the version is stored in the device persistent property : org.openmobileis.synchro.bundle.fullupdate.version - OpenMIS-PostInstall-Class : a class (implements FullUpdatePostInstallInterface) that is executed after installation before open mobile is Framework is started (webserver). After the synchronization if a update file is available, an update program is call to do the update. The update program is define with the property org.openmobileis.bundle.update.updateprg and the prg parameter with the property org.openmobileis.bundle.update.updateprgparam If the properties aren't defined the update is not done.

Author:
phil

Field Summary
protected  java.lang.String synchroPath
           
 
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
FullAppUpdateListener()
          Module that synchronize the application jar.
 
Method Summary
 void endSync()
          Fire this event once the current synchro is ended
 java.lang.String getJarInstallPath()
           
 java.lang.String getSyncName()
          Return the name used to identiy the of the listener in the synchro processus.
 void initManager()
           
 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 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, equals, getJournalLogRenderer, getSynchroStatus, hashCode, initListener, isSyncOK, notifySynchroFailure, receiveAddCommand, receiveDeleteCommand, receiveGetCommand, receiveReplaceCommand, receiveSyncCommand, receiveSyncItem, setSynchroStatus
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

synchroPath

protected java.lang.String synchroPath
Constructor Detail

FullAppUpdateListener

public FullAppUpdateListener()
Module that synchronize the application jar. The jar are copied in the user.dir/temp directory. The application restarted and the jar unzipped in at the root path defined in the jar META_INF/rootunzippath directive Use to update full application

Method Detail

initManager

public void initManager()
                 throws ServiceException
Throws:
ServiceException

getSyncName

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


getJarInstallPath

public java.lang.String getJarInstallPath()

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

endSync

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

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

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

Throws:
OpenMSPException


Copyright 2006 OpenMobileIS. All Rights Reserved.