Package weka.core.packageManagement
Class Package
java.lang.Object
weka.core.packageManagement.Package
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
DefaultPackage
Abstract base class for Packages.
- Version:
- $Revision: 52462 $
- Author:
- mhall (mhall{[at]}pentaho{[dot]}com)
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract Object
clone()
boolean
Compare the supplied package to this package.abstract List<Dependency>
Gets the dependency on the base system that this package requires.abstract List<Dependency>
Get the list of packages that this package depends on.abstract List<Dependency>
Gets a list of installed packages that this package depends on that are currently incompatible with this package.abstract List<Dependency>
getIncompatibleDependencies
(List<Package> packages) Gets those packages from the supplied list that this package depends on and are currently incompatible with this package.abstract List<Dependency>
Gets a list of packages that this package depends on that are not currently installed.abstract List<Dependency>
getMissingDependencies
(List<Package> packages) Gets a list of packages that this package depends on that are not in the supplied list of packages.abstract String
getName()
Convenience method to return the name of this package.Map<?,
?> Get the meta data for this package.Gets the package meta data element associated with the supplied key.abstract URL
Convenience method that returns the URL to the package (i.e the provider's URL).getPrecludedPackages
(List<Package> packages) Compares this package's precluded list (if any) against the list of supplied packages.abstract void
install()
Install this package.abstract boolean
Returns true if this package is compatible with the currently installed version of the base system.abstract boolean
Returns true if this package is already installedvoid
setPackageMetaData
(Map<?, ?> metaData) Set the meta data for this package.abstract void
setPackageMetaDataElement
(Object key, Object value) Adds a key, value pair to the meta data map.
-
Constructor Details
-
Package
public Package()
-
-
Method Details
-
setPackageMetaData
Set the meta data for this package.- Parameters:
metaData
- the meta data for this package.
-
getPackageMetaData
Get the meta data for this package.- Returns:
- the meta data for this package
-
getName
Convenience method to return the name of this package.- Returns:
- the name of this package.
-
getPackageURL
Convenience method that returns the URL to the package (i.e the provider's URL). This information is assumed to be stored in the package meta data.- Returns:
- the URL to the package or null if the URL is not available for some reason
- Throws:
Exception
- if the URL can't be retrieved for some reason
-
equals
Compare the supplied package to this package. Simply does an equals() comparison between the two. Concrete subclasses should override if they wan't to do comparison based on specific package meta data elements.- Parameters:
toCompare
- the package to compare against.- Returns:
- true if the supplied package is equal to this one.
-
getDependencies
Get the list of packages that this package depends on.- Returns:
- the list of packages that this package depends on.
- Throws:
Exception
- if a problem occurs while getting the list of dependencies.
-
isInstalled
public abstract boolean isInstalled()Returns true if this package is already installed- Returns:
- true if this package is installed
-
install
Install this package.- Throws:
Exception
- if something goes wrong during installation.
-
isCompatibleBaseSystem
Returns true if this package is compatible with the currently installed version of the base system.- Returns:
- true if this package is compatible with the main software system.
- Throws:
Exception
- if a problem occurs while checking compatibility.
-
getBaseSystemDependency
Gets the dependency on the base system that this package requires.- Returns:
- the base system dependency(s) for this package
- Throws:
Exception
- if the base system dependency can't be determined for some reason.
-
getMissingDependencies
Gets a list of packages that this package depends on that are not currently installed.- Returns:
- a list of missing packages that this package depends on.
- Throws:
Exception
-
getMissingDependencies
Gets a list of packages that this package depends on that are not in the supplied list of packages.- Parameters:
packages
- a list of packages to compare this package's dependencies against.- Returns:
- those packages that this package depends on that aren't in the supplied list.
- Throws:
Exception
- if the list of missing depenencies can't be determined for some reason.
-
getIncompatibleDependencies
Gets a list of installed packages that this package depends on that are currently incompatible with this package.- Returns:
- a list of incompatible installed packages that this package depends on.
- Throws:
Exception
-
getPrecludedPackages
Compares this package's precluded list (if any) against the list of supplied packages. Any packages in the supplied list that match (by name and version constraints) any in the precluded list are returned- Parameters:
packages
- a list of packages to compare against those in this package's precluded list- Returns:
- a list of packages that are covered by those in the precluded list
- Throws:
Exception
- if a problem occurs
-
getIncompatibleDependencies
public abstract List<Dependency> getIncompatibleDependencies(List<Package> packages) throws Exception Gets those packages from the supplied list that this package depends on and are currently incompatible with this package.- Parameters:
packages
- a list of packages to compare this package's dependencies against- Returns:
- those packages from the supplied list that are incompatible with respect to this package's dependencies
- Throws:
Exception
- if the list of incompatible dependencies can't be generated for some reason.
-
getPackageMetaDataElement
Gets the package meta data element associated with the supplied key.- Parameters:
key
- the key to use to look up a value in the meta data- Returns:
- the meta data value or null if the key does not exist.
-
setPackageMetaDataElement
Adds a key, value pair to the meta data map.- Parameters:
key
- the keyvalue
- the value to add- Throws:
Exception
- if there is no meta data map to add to.
-
clone
-