|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.funambol.syncclient.spap.AssetManager
public class AssetManager
This class supplies the methods for the management of the Asset
.
Manages the synchronization process, the installation process and the uninstallation process of the assets.
Uses AssetDAO
for retrieves the information of the asset.
It's a singleton class and for to get an instance you need to use the
getAssetManager()
static method.
Method Summary | |
---|---|
void |
addAsset(Asset asset)
Adds the given asset. |
Asset |
getAsset(java.lang.String idAsset)
Returns the asset with the given identifier |
static AssetManager |
getAssetManager()
Method used for obtain a instance of a AssetManager |
java.lang.String |
getAssetState(java.lang.String idAsset)
Returns the state of the asset identified from the given id |
java.lang.String |
getBinDirectory()
Returns property installationDirectory |
java.lang.String |
getInstallationDirectory()
Returns property installationDirectory |
java.lang.String |
getLibDirectory()
Returns property installationDirectory |
void |
installAsset(java.lang.String idAsset)
Starts the installation process of a asset. |
boolean |
isCheckPackageSize()
|
java.util.Vector |
listAssets(java.lang.String state)
Returns the list of the asset with the given state. |
java.util.Vector |
listAssets(java.lang.String[] states)
Returns the list of the asset with the given states |
java.util.Vector |
listAssetsForInstallation()
Return list of asset that require the installation process |
java.util.Vector |
listAssetsForRemoving()
Return list of asset that require the uninstallation process |
void |
removeAsset(java.lang.String idAsset)
Remove a asset. |
void |
setAssetAsNotWanted(java.lang.String idAsset)
Sets asset's state to Asset.STATE_NEW_VERSION_NOT_WISHED |
void |
setAssetState(Asset asset,
java.lang.String state)
Set the state of the given asset. |
void |
setBinDirectory(java.lang.String binDirectory)
Sets property |
void |
setCheckPackageSize(boolean checkPackageSize)
|
void |
setInstallationDirectory(java.lang.String installationDirectory)
Sets property |
void |
setLibDirectory(java.lang.String libDirectory)
Sets property |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void setInstallationDirectory(java.lang.String installationDirectory)
installationDirectory
- description: directory in the which installs the assets
displayName: installationDirectorypublic java.lang.String getInstallationDirectory()
public void setBinDirectory(java.lang.String binDirectory)
binDirectory
- description: directory for executables
displayName: binDirectorypublic java.lang.String getBinDirectory()
public void setLibDirectory(java.lang.String libDirectory)
libDirectory
- description: directory for classes and libraries
displayName: libDirectorypublic java.lang.String getLibDirectory()
public void setCheckPackageSize(boolean checkPackageSize)
public boolean isCheckPackageSize()
public static AssetManager getAssetManager() throws java.lang.IllegalStateException
AssetManager
AssetManager
java.lang.IllegalStateException
- if an error occurs during the initialization
processpublic void installAsset(java.lang.String idAsset) throws AssetManagementException
This method is used for to install a new asset and for to update a asset.
A asset requires a installation if his state is:
STATE_NEW
STATE_UPDATE
STATE_CONTENT_DOWNLOAD
STATE_CONTENT_EXTRACTED
STATE_PREVIOUS_VERSION_UNINSTALLED
The installation process is composed by the following task:
idAsset
- identifier of the asset to install
AssetManagementException
- if not exists a newVersion or if an error
occurs during installation processspublic void removeAsset(java.lang.String idAsset) throws AssetManagementException
The state of the asset must be
STATE_DELETE
The remove process is composed by the following task:
idAsset
- identifier of the asset to remove
AssetManagementException
- if an error occurs or if asset not existspublic java.util.Vector listAssetsForInstallation()
A asset requires a installation if his state is:
STATE_NEW
STATE_UPDATE
STATE_FILE_DOWNLOAD
STATE_FILE_EXTRACTED
STATE_PREVIOUS_VERSION_UNINSTALLED
public java.util.Vector listAssetsForRemoving()
A asset requires a uninstallation if its state is:
STATE_DELETE
public java.util.Vector listAssets(java.lang.String[] states)
states
- array of the state
public java.util.Vector listAssets(java.lang.String state)
If the given state is null
returns the all assets
state
- array of the state. If null
returns the all assets
public java.lang.String getAssetState(java.lang.String idAsset) throws AssetManagementException
idAsset
- identifier of the asset
AssetManagementException
- if asset not existspublic void setAssetState(Asset asset, java.lang.String state) throws AssetManagementException
asset
- the asset to be setstate
- the new state
AssetManagementException
- in case of errorspublic Asset getAsset(java.lang.String idAsset) throws AssetManagementException
idAsset
- the identifier of the asset
AssetManagementException
- if Asset not existpublic void setAssetAsNotWanted(java.lang.String idAsset) throws AssetManagementException
idAsset
- identifier of the asset
AssetManagementException
- if an error occurspublic void addAsset(Asset asset) throws AssetManagementException
asset
- the asset to add
AssetManagementException
- in case of errors
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |