public abstract class PackageManager extends Object
| Constructor and Description |
|---|
PackageManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
applySettings(Settings settings)
Apply the supplied settings.
|
static PackageManager |
create() |
void |
establishProxy()
Tries to configure a Proxy object for use in an Authenticator if there is a
proxy defined by the properties http.proxyHost and http.proxyPort, and if
the user has set values for the properties (note, these are not standard
java properties) http.proxyUser and http.proxyPassword.
|
abstract List<Dependency> |
getAllDependenciesForPackage(Package target,
Map<String,List<Dependency>> conflicts)
Gets a full list of packages (encapsulated in Dependency objects) that are
required by directly and indirectly by the named target package.
|
abstract List<Package> |
getAllPackages(PrintStream... progress)
Get all packages that the system knows about (i.e.
|
abstract List<Package> |
getAvailablePackages()
Get a list of packages that are not currently installed.
|
String |
getBaseSystemName()
Get the name of the main software system for which we manage packages.
|
Object |
getBaseSystemVersion()
Get the current installed version of the main system for which we manage
packages.
|
Defaults |
getDefaultSettings()
Get the default settings of this package manager.
|
abstract Package |
getInstalledPackageInfo(String packageName)
Get package information on the named installed package.
|
abstract List<Package> |
getInstalledPackages()
Get a list of installed packages.
|
abstract Package |
getPackageArchiveInfo(String packageArchivePath)
Get package information from the supplied package archive file.
|
File |
getPackageHome()
Get the location (directory) of installed packages
|
URL |
getPackageRepositoryURL()
Get the URL to the repository of package meta data.
|
Proxy |
getProxy()
Get the proxy in use.
|
abstract Package |
getRepositoryPackageInfo(String packageName)
Get package information on the named package from the repository.
|
abstract Package |
getRepositoryPackageInfo(String packageName,
Object version)
Get package information on the named package from the repository.
|
abstract byte[] |
getRepositoryPackageMetaDataOnlyAsZip(PrintStream... progress)
Gets an array of bytes containing a zip of all the repository meta data and
supporting files.
|
abstract List<Object> |
getRepositoryPackageVersions(String packageName)
Get a list of available versions of the named package.
|
abstract Package |
getURLPackageInfo(URL packageURL)
Get package information on the package at the given URL.
|
abstract String |
installPackageFromArchive(String packageArchivePath,
PrintStream... progress)
Install a package from an archive on the local file system.
|
abstract void |
installPackageFromRepository(String packageName,
Object version,
PrintStream... progress)
Install a package sourced from the repository.
|
abstract String |
installPackageFromURL(URL packageURL,
PrintStream... progress)
Install a package sourced from a given URL.
|
abstract void |
installPackages(List<Package> toInstall,
PrintStream... progress)
Installs all the packages in the supplied list.
|
void |
setBaseSystemName(String baseS)
Set the name of the main software system for which we manage packages.
|
void |
setBaseSystemVersion(Object systemV)
Set the current version of the base system for which we manage packages.
|
void |
setPackageHome(File packageHome)
Set the location (directory) of installed packages.
|
void |
setPackageRepositoryURL(URL repositoryURL)
Set the URL to the repository of package meta data.
|
void |
setProxy(Proxy proxyToUse)
Set a proxy to use for accessing the internet (default is no proxy).
|
boolean |
setProxyAuthentication(URL urlToConnectTo)
Sets an new default Authenticator that will return the values set through
setProxyUsername() and setProxyPassword() (if applicable).
|
void |
setProxyPassword(String proxyPassword)
Set the password for authentication with the proxy.
|
void |
setProxyUsername(String proxyUsername)
Set the user name for authentication with the proxy.
|
abstract void |
uninstallPackage(String packageName,
PrintStream... progress)
Uninstall a package.
|
public static PackageManager create()
public void establishProxy()
public boolean setProxyAuthentication(URL urlToConnectTo)
public void setPackageHome(File packageHome)
packageHome - the file system location of installed packages.public File getPackageHome()
public void setBaseSystemName(String baseS)
baseS - the name of the base software systempublic String getBaseSystemName()
public void setBaseSystemVersion(Object systemV)
systemV - the current version of the main software system.public Object getBaseSystemVersion()
public void setPackageRepositoryURL(URL repositoryURL)
repositoryURL - the URL to the repository of package meta data.public URL getPackageRepositoryURL()
public void setProxy(Proxy proxyToUse)
proxyToUse - a proxy to use.public Proxy getProxy()
public void setProxyUsername(String proxyUsername)
proxyUsername - the user name to use for proxy authentication.public void setProxyPassword(String proxyPassword)
proxyPassword - the password to use for proxy authentication.public Defaults getDefaultSettings()
public void applySettings(Settings settings)
settings - the settings to applypublic abstract byte[] getRepositoryPackageMetaDataOnlyAsZip(PrintStream... progress) throws Exception
progress - optional varargs parameter, that, if supplied, is expected
to contain one or more PrintStream objects to write progress to.Exception - if the repository meta data can't be returned as a zippublic abstract Package getPackageArchiveInfo(String packageArchivePath) throws Exception
packageArchivePath - the path to the package archive fileException - if the package meta data can't be retrieved.public abstract Package getInstalledPackageInfo(String packageName) throws Exception
packageName - the name of the package to get information about.Exception - if the package meta data can't be retrieved.public abstract Package getRepositoryPackageInfo(String packageName) throws Exception
packageName - the name of the package to get information about.Exception - if the package meta data can't be retrieved.public abstract Package getRepositoryPackageInfo(String packageName, Object version) throws Exception
packageName - the name of the package to get information about.version - the version of the package to retrieve (may be null if not
applicable).Exception - if the package meta data can't be retrieved.public abstract List<Object> getRepositoryPackageVersions(String packageName) throws Exception
packageName - the name of the package to get versions.Exception - if something goes wrong while trying to retrieve the list
of versions.public abstract Package getURLPackageInfo(URL packageURL) throws Exception
packageURL - the URL to the package.Exception - if the package meta data can't be retrieved.public abstract String installPackageFromArchive(String packageArchivePath, PrintStream... progress) throws Exception
packageArchivePath - the path to the package archive file.progress - optional varargs parameter, that, if supplied, is expected
to contain one or more PrintStream objects to write progress to.Exception - if the package can't be installed for some reason.public abstract void installPackageFromRepository(String packageName, Object version, PrintStream... progress) throws Exception
packageName - the name of the package to installversion - the version of the package to install (may be null if not
applicable).progress - optional varargs parameter, that, if supplied, is expected
to contain one or more PrintStream objects to write progress to.Exception - if the package can't be installed for some reason.public abstract String installPackageFromURL(URL packageURL, PrintStream... progress) throws Exception
packageURL - the URL to the package.progress - optional varargs parameter, that, if supplied, is expected
to contain one or more PrintStream objects to write progress to.Exception - if the package can't be installed for some reason.public abstract void installPackages(List<Package> toInstall, PrintStream... progress) throws Exception
toInstall - a list of Packages to install.progress - optional varargs parameter, that, if supplied, is expected
to contain one or more PrintStream objects to write progress to.Exception - if something goes wrong during the installation process.public abstract void uninstallPackage(String packageName, PrintStream... progress) throws Exception
packageName - the package to uninstall.progress - optional varargs parameter, that, if supplied, is expected
to contain one or more PrintStream objects to write progress to.Exception - if the named package could not be removed for some
reason.public abstract List<Package> getInstalledPackages() throws Exception
Exception - if a list of packages can't be determined.public abstract List<Package> getAllPackages(PrintStream... progress) throws Exception
progress - optional varargs parameter, that, if supplied is expected
to contain one or more PrintStream objects to write progress to.Exception - if a list of packages can't be determined.public abstract List<Package> getAvailablePackages() throws Exception
Exception - if a list of packages can't be determined.public abstract List<Dependency> getAllDependenciesForPackage(Package target, Map<String,List<Dependency>> conflicts) throws Exception
target - the package for which a list of dependencies is required.conflicts - will hold any conflicts that are discovered while building
the full dependency list.Exception - if a problem occurs while building the dependency list.Copyright © 2016 University of Waikato, Hamilton, NZ. All Rights Reserved.