|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.pentaho.packageManagement.Package
org.pentaho.packageManagement.DefaultPackage
public class DefaultPackage
A concrete implementation of Package that uses Java properties files/classes to manage package meta data. Assumes that meta data for individual packages is stored on the central repository (or possibly in a local cache - both accessible via http) in properties files that live in a sub-directory with the same name as the package. Furthermore, each property file is assumed to be named as the version number of the package in question with a ".props" extension. A "Latest.props" file should exist for each package and should always hold meta data on the latest version of a package.
| Field Summary | |
|---|---|
protected File |
m_packageHome
Holds the home directory for installed packages |
protected PackageManager |
m_packageManager
The package manager in use |
| Fields inherited from class org.pentaho.packageManagement.Package |
|---|
m_packageMetaData |
| Constructor Summary | |
|---|---|
DefaultPackage(File packageHome,
PackageManager manager)
Constructs a new DefaultPackage. |
|
DefaultPackage(File packageHome,
PackageManager manager,
Map<?,?> packageMetaData)
Constructs an new DefaultPackage. |
|
| Method Summary | |
|---|---|
Object |
clone()
Clone this package. |
List<Dependency> |
getBaseSystemDependency()
Gets the dependency on the base system that this package requires. |
List<Dependency> |
getDependencies()
Get the list of packages that this package depends on. |
List<Dependency> |
getIncompatibleDependencies()
Gets a list of installed packages that this package depends on that are currently incompatible with this package. |
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. |
List<Dependency> |
getMissingDependencies()
Gets a list of packages that this package depends on that are not currently installed. |
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. |
String |
getName()
Convenience method to return the name of this package. |
URL |
getPackageURL()
Convenience method that returns the URL to the package (i.e the provider's URL). |
void |
install()
Install this package. |
boolean |
isCompatibleBaseSystem()
Returns true if this package is compatible with the currently installed version of the base system. |
boolean |
isInstalled()
Returns true if this package is already installed ²@return true if this package is installed |
static void |
main(String[] args)
|
void |
setPackageMetaDataElement(Object key,
Object value)
Adds a key, value pair to the meta data map. |
protected static String[] |
splitNameVersion(String nameAndVersion)
|
String |
toString()
|
| Methods inherited from class org.pentaho.packageManagement.Package |
|---|
equals, getPackageMetaData, getPackageMetaDataElement, setPackageMetaData |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected File m_packageHome
protected PackageManager m_packageManager
| Constructor Detail |
|---|
public DefaultPackage(File packageHome,
PackageManager manager,
Map<?,?> packageMetaData)
packageHome - the directory that packages are installed into.manager - the package manager in use.packageMetaData - A Map of package meta data for this package.
public DefaultPackage(File packageHome,
PackageManager manager)
packageHome - the directory that packages are installed into.manager - the package manager in use.| Method Detail |
|---|
public Object clone()
clone in class Package
public URL getPackageURL()
throws Exception
getPackageURL in class PackageException - if the URL can't be retrieved for some reasonpublic String getName()
getName in class Packageprotected static String[] splitNameVersion(String nameAndVersion)
public List<Dependency> getDependencies()
throws Exception
getDependencies in class PackageException - if a problem occurs while getting the list of
dependencies.
public List<Dependency> getBaseSystemDependency()
throws Exception
getBaseSystemDependency in class PackageException - if the base system dependency can't be determined for
some reason.
public List<Dependency> getMissingDependencies(List<Package> packages)
throws Exception
getMissingDependencies in class Packagepackages - a list of packages to compare this package's dependencies
against.
Exception - if the list of missing depenencies can't be determined
for some reason.
public List<Dependency> getMissingDependencies()
throws Exception
getMissingDependencies in class PackageException
public List<Dependency> getIncompatibleDependencies(List<Package> packages)
throws Exception
getIncompatibleDependencies in class Packagepackages - a list of packages to compare this package's dependencies
against
Exception - if the list of incompatible dependencies can't be
generated for some reason.
public List<Dependency> getIncompatibleDependencies()
throws Exception
getIncompatibleDependencies in class PackageException
public boolean isCompatibleBaseSystem()
throws Exception
isCompatibleBaseSystem in class PackageException - if a problem occurs while checking compatibility.
public void install()
throws Exception
install in class PackageException - if something goes wrong during installation.public boolean isInstalled()
isInstalled in class Packagepublic static void main(String[] args)
public void setPackageMetaDataElement(Object key,
Object value)
throws Exception
setPackageMetaDataElement in class Packagekey - the keyvalue - the value to add
Exception - if there is no meta data map to add to.public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||