public class PackageManager
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
swigCMemOwn |
Constructor and Description |
---|
PackageManager(long cPtr,
boolean cMemoryOwn) |
PackageManager(java.lang.String packageListUrl,
java.lang.String dataFolder,
java.lang.String serverEncKey,
java.lang.String localEncKey)
Constructs a new package manager, given URL for package list and data folder.
The data folder must exist before creating a new package manager and it is assumed to be persistent. Note: the package manager must be explicitly started using start() method! |
Modifier and Type | Method and Description |
---|---|
void |
cancelPackageTasks(java.lang.String packageId)
Cancels the current/pending tasks involving of the specified package.
|
void |
delete() |
boolean |
equals(java.lang.Object obj)
Checks if this object is equal to the specified object.
|
protected void |
finalize() |
static long |
getCPtr(PackageManager obj) |
PackageInfo |
getLocalPackage(java.lang.String packageId)
Returns the specified local package.
|
PackageInfoVector |
getLocalPackages()
Returns the list of available local downloaded packages.
|
PackageStatus |
getLocalPackageStatus(java.lang.String packageId,
int version)
Returns the status of the specified package.
|
PackageManagerListener |
getPackageManagerListener()
Returns the current listener for package manager events.
|
PackageInfo |
getServerPackage(java.lang.String packageId)
Returns the specified server package.
Note that the list must be retrieved from the server first, using startPackageListDownload. |
int |
getServerPackageListAge()
Returns the age of server package list.
|
PackageMetaInfo |
getServerPackageListMetaInfo()
Returns the metainfo of server packages.
|
PackageInfoVector |
getServerPackages()
Returns the list of available server packages.
Note that the list must be retrieved from the server first, using startPackageListDownload. |
int |
hashCode()
Returns the hash value of this object.
|
void |
setPackageManagerListener(PackageManagerListener listener)
Sets the package manager listener.
|
void |
setPackagePriority(java.lang.String packageId,
int priority)
Sets the priority of the specific package.
If the given priority is higher than priority of any other package, other operations will be paused and this package is processed immediately. If the given priority is set to negative value, package download will be paused until priority is reset to non-negative value. |
boolean |
start()
Starts the package manager.
|
boolean |
startPackageDownload(java.lang.String packageId)
Starts downloading specified package asynchronously.
|
boolean |
startPackageImport(java.lang.String packageId,
int version,
java.lang.String packageFileName)
Starts importing the specified package asynchronously.
|
boolean |
startPackageListDownload()
Starts downloading package list asynchronously.
|
boolean |
startPackageRemove(java.lang.String packageId)
Starts the removal of specified package asynchronously.
|
void |
stop(boolean wait)
Stops the package manager.
|
static PackageManager |
swigCreatePolymorphicInstance(long cPtr,
boolean cMemoryOwn)
Creates a polymorphic instance of the given native object.
|
java.lang.String |
swigGetClassName()
Returns the actual class name of this object.
|
java.lang.Object |
swigGetDirectorObject()
Returns the connected director object.
|
public PackageManager(long cPtr, boolean cMemoryOwn)
public PackageManager(java.lang.String packageListUrl, java.lang.String dataFolder, java.lang.String serverEncKey, java.lang.String localEncKey)
packageListUrl
- The URL that defines all packages.dataFolder
- The folder where downloaded packages are kept. It must exist and must be writable.serverEncKey
- Encryption key for server packageslocalEncKey
- Encryption key for local packagespublic static long getCPtr(PackageManager obj)
protected void finalize()
finalize
in class java.lang.Object
public void delete()
public static PackageManager swigCreatePolymorphicInstance(long cPtr, boolean cMemoryOwn)
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public PackageManagerListener getPackageManagerListener()
public void setPackageManagerListener(PackageManagerListener listener)
listener
- The new package manager listener to use.public boolean start()
public void stop(boolean wait)
wait
- If set to true, then synchronous stopping is performed and the operation may take a while.public PackageInfoVector getServerPackages()
public PackageInfoVector getLocalPackages()
public PackageMetaInfo getServerPackageListMetaInfo()
public int getServerPackageListAge()
public PackageInfo getServerPackage(java.lang.String packageId)
public PackageInfo getLocalPackage(java.lang.String packageId)
public PackageStatus getLocalPackageStatus(java.lang.String packageId, int version)
packageId
- The id of the package.version
- The version of the package. Use -1 for the latest version.public boolean startPackageListDownload()
public boolean startPackageImport(java.lang.String packageId, int version, java.lang.String packageFileName)
packageId
- The id of the package to download.version
- The version of the package.packageFileName
- The fully qualified path of the package.public boolean startPackageDownload(java.lang.String packageId)
packageId
- The id of the package to download.public boolean startPackageRemove(java.lang.String packageId)
packageId
- The id of the package to remove.public void cancelPackageTasks(java.lang.String packageId)
packageId
- The id of the package to cancelpublic void setPackagePriority(java.lang.String packageId, int priority)
packageId
- The id of the download package.priority
- The priority of the download package. If it is less than zero, package download is paused.public java.lang.String swigGetClassName()
public java.lang.Object swigGetDirectorObject()