public abstract class PackageManagementService
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
PackageManagementService.ErrorDescription |
static interface |
PackageManagementService.Listener |
Constructor and Description |
---|
PackageManagementService() |
Modifier and Type | Method and Description |
---|---|
void |
addRepository(java.lang.String repositoryUrl) |
boolean |
canInstallToUser()
Returns true if the 'install to user' checkbox should be visible.
|
boolean |
canManageRepositories()
Returns true if the service supports managing repositories.
|
boolean |
canModifyRepository(java.lang.String repositoryUrl)
Checks if the user can change the URL of the specified repository or remove it from the list.
|
int |
compareVersions(java.lang.String version1,
java.lang.String version2) |
void |
fetchAllRepositories(CatchingConsumer<? super java.util.List<java.lang.String>,? super java.lang.Exception> consumer)
An async version of
getAllRepositories() . |
abstract void |
fetchPackageDetails(java.lang.String packageName,
CatchingConsumer<java.lang.String,java.lang.Exception> consumer) |
abstract void |
fetchPackageVersions(java.lang.String packageName,
CatchingConsumer<java.util.List<java.lang.String>,java.lang.Exception> consumer) |
abstract java.util.List<RepoPackage> |
getAllPackages()
Returns the list of all packages in all configured repositories.
|
java.util.List<RepoPackage> |
getAllPackagesCached()
Returns the cached list of all packages in all configured repositories, or an empty list if there is no cached information available.
|
java.util.List<java.lang.String> |
getAllRepositories()
Returns the list of URLs for all configured package repositories.
|
java.lang.String |
getID() |
abstract java.util.Collection<InstalledPackage> |
getInstalledPackages()
Returns the list of packages which are currently installed.
|
java.lang.String |
getInstallToUserText()
Returns the text of the 'install to user' checkbox.
|
abstract void |
installPackage(RepoPackage repoPackage,
java.lang.String version,
boolean forceUpgrade,
java.lang.String extraOptions,
PackageManagementService.Listener listener,
boolean installToUser)
Installs the specified package.
|
void |
installToUserChanged(boolean newValue)
Called when the 'install to user' checkbox is checked or unchecked.
|
boolean |
isInstallToUserSelected()
Returns true if the 'install to user' checkbox should be initially selected.
|
abstract java.util.List<RepoPackage> |
reloadAllPackages()
Reloads the lists of packages for all configured repositories and returns the results.
|
void |
removeRepository(java.lang.String repositoryUrl) |
abstract void |
uninstallPackages(java.util.List<InstalledPackage> installedPackages,
PackageManagementService.Listener listener) |
public java.util.List<java.lang.String> getAllRepositories()
public void fetchAllRepositories(CatchingConsumer<? super java.util.List<java.lang.String>,? super java.lang.Exception> consumer)
getAllRepositories()
.public boolean canManageRepositories()
public boolean canModifyRepository(java.lang.String repositoryUrl)
repositoryUrl
- the URL to checkpublic void addRepository(java.lang.String repositoryUrl)
public void removeRepository(java.lang.String repositoryUrl)
public int compareVersions(java.lang.String version1, java.lang.String version2)
public abstract java.util.List<RepoPackage> getAllPackages() throws java.io.IOException
java.io.IOException
public abstract java.util.List<RepoPackage> reloadAllPackages() throws java.io.IOException
java.io.IOException
public java.util.List<RepoPackage> getAllPackagesCached()
public boolean canInstallToUser()
public java.lang.String getInstallToUserText()
public boolean isInstallToUserSelected()
public void installToUserChanged(boolean newValue)
public abstract java.util.Collection<InstalledPackage> getInstalledPackages() throws java.io.IOException
java.io.IOException
public abstract void installPackage(RepoPackage repoPackage, java.lang.String version, boolean forceUpgrade, java.lang.String extraOptions, PackageManagementService.Listener listener, boolean installToUser)
repoPackage
- the package to installversion
- the version selected by the user, or null if the checkbox to install a specific version is not checkedforceUpgrade
- if true, the latest version of the package is installed even if there is already an installed versionextraOptions
- additional options entered by the userlistener
- the listener that must be called to publish information about the installation progressinstallToUser
- the state of the "install to user" checkbox (ignore if not applicable)public abstract void uninstallPackages(java.util.List<InstalledPackage> installedPackages, PackageManagementService.Listener listener)
public abstract void fetchPackageVersions(java.lang.String packageName, CatchingConsumer<java.util.List<java.lang.String>,java.lang.Exception> consumer)
public abstract void fetchPackageDetails(java.lang.String packageName, CatchingConsumer<java.lang.String,java.lang.Exception> consumer)
public java.lang.String getID()