com.funambol.syncclient.spap
Class ApplicationManager

java.lang.Object
  extended by com.funambol.syncclient.spap.ApplicationManager

public class ApplicationManager
extends java.lang.Object

This class is responsible for the management of the SyncClient Conduit applications. It performs the following tasks:

Installation packages

An installation package is a jar file containing a SyncClient Conduit application. It is structured as follows:

   - {application-description-file}.adf
   - {other packages and classes}
   - bin
     - {other binary files}
 
For example:
  - soccerleagues.adf
  - com
    - funambol
      - soccerleagues
        - SoccerleaguesStoreManager.class
  - bin
    - Leagues.prc
    - Italy.pdb
    - England.pdb
 
The package is first save as an asset, so that it can be handled by the application provisioning subsystem.

Version:
$Id: ApplicationManager.java,v 1.3 2007-12-22 18:09:17 nichele Exp $

Field Summary
static java.lang.String[] ALLOWED_SYNC_MODES
           
 
Constructor Summary
ApplicationManager(ManagementNode applicationConfigNode)
          Creates a new instance of ApplicationManager.
 
Method Summary
static Application applicationFromADF(java.lang.String adf)
          Creates an application object from the ADF file.
static Application applicationFromAsset(Asset asset)
          Creates an application object from an asset.
 Application[] getApplications()
          Returns the installed applications.
 Application install(java.io.File f)
          Install an application packaged in a jar/zip file as described in the class description.
static Asset makeAsset(Application app, java.io.File packageFile)
          Creates an Asset object from an Application and its package.
 void uninstall(Application app)
          Uninstall the application ideintified by the given application URI.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALLOWED_SYNC_MODES

public static java.lang.String[] ALLOWED_SYNC_MODES
Constructor Detail

ApplicationManager

public ApplicationManager(ManagementNode applicationConfigNode)
Creates a new instance of ApplicationManager. It stores the application configuration management tree and the executables directory for further use.

Parameters:
applicationConfigNode - application configuration management tree
Method Detail

install

public Application install(java.io.File f)
                    throws ApplicationManagementException
Install an application packaged in a jar/zip file as described in the class description.

The file is read and copied in the installation directory; then the DM structure required by the application provisioning subsystem is created so that the application looks like an installable asset.

Parameters:
f - the package file
Throws:
ApplicationManagementException - if an error occurs during installation

uninstall

public void uninstall(Application app)
               throws ApplicationManagementException
Uninstall the application ideintified by the given application URI. It removes both the application classes and configuration files.

Parameters:
app - the application to unistall
Throws:
ApplicationManagementException - in case of errors

getApplications

public Application[] getApplications()
                              throws ApplicationManagementException
Returns the installed applications.

Returns:
an array containing the installed applications
Throws:
ApplicationManagementException

applicationFromADF

public static Application applicationFromADF(java.lang.String adf)
                                      throws ApplicationManagementException
Creates an application object from the ADF file. An exception is thrown if any error is found and the application object cannot be created.

Parameters:
adf - the adf content
Throws:
ApplicationManagementException - if there is something wrong with the ADF

applicationFromAsset

public static Application applicationFromAsset(Asset asset)
                                        throws ApplicationManagementException
Creates an application object from an asset. An exception is thrown if any error is found and the application object cannot be created.

Parameters:
asset - the asset from which create the application
Throws:
ApplicationManagementException - if there is something wrong with the asset

makeAsset

public static Asset makeAsset(Application app,
                              java.io.File packageFile)
                       throws ApplicationManagementException
Creates an Asset object from an Application and its package.

Parameters:
app - the application object
packageFile - the package file - NULL
Throws:
ApplicationManagementException - if something gets wrong


Copyright © 2010 Funambol. All Rights Reserved.