public class WekaPackageManager extends Object
| Modifier and Type | Field and Description |
|---|---|
static Set<String> |
m_doNotLoadList
The set of packages that the user has requested not to load
|
static boolean |
m_initialPackageLoadingInProcess
Package loading in progress?
|
static boolean |
m_noPackageMetaDataAvailable |
static boolean |
m_offline
Operating offline?
|
static File |
PACKAGES_DIR
The default packages directory
|
static File |
PROPERTIES_DIR
The default properties directory
|
static File |
WEKA_HOME
Default path to where Weka's configuration and packages are stored
|
| Constructor and Description |
|---|
WekaPackageManager() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
checkForMissingClasses(org.pentaho.packageManagement.Package toLoad,
PrintStream... progress)
Checks to see if there are any classes that we should try to instantiate
before allowing this package to be loaded.
|
static boolean |
checkForMissingFiles(org.pentaho.packageManagement.Package toLoad,
File packageRoot,
PrintStream... progress)
Checks to see if there are any missing files/directories for a given
package.
|
static Exception |
checkForNewPackages(PrintStream... progress)
Check for new packages on the server and refresh the local cache if needed
|
static boolean |
checkForUnsetEnvVar(org.pentaho.packageManagement.Package toLoad,
PrintStream... progress)
Checks to see if there are any environment variables or properties that
should be set at startup before allowing this package to be loaded.
|
static Exception |
establishCacheIfNeeded(PrintStream... progress)
Establish the local copy of the package meta data if needed
|
static List<org.pentaho.packageManagement.Dependency> |
getAllDependenciesForPackage(org.pentaho.packageManagement.Package target,
Map<String,List<org.pentaho.packageManagement.Dependency>> conflicts)
Get a list of dependencies for a given package
|
static List<org.pentaho.packageManagement.Package> |
getAllPackages()
Get a list of all packages
|
static List<org.pentaho.packageManagement.Package> |
getAvailableCompatiblePackages()
Get a list of the most recent version of all available packages (i.e.
|
static List<org.pentaho.packageManagement.Package> |
getAvailablePackages()
Get a list of all available packages (i.e.
|
static org.pentaho.packageManagement.Package |
getInstalledPackageInfo(String packageName)
Get meta data for an installed package
|
static List<org.pentaho.packageManagement.Package> |
getInstalledPackages()
Get a list of installed packages
|
static org.pentaho.packageManagement.Package |
getPackageArchiveInfo(String packageArchivePath)
Extract meta data from a package archive
|
static File |
getPackageHome() |
static Map<String,String> |
getPackageList(boolean local)
Just get a list of the package names.
|
static URL |
getPackageRepositoryURL()
Get the package repository URL
|
static org.pentaho.packageManagement.Package |
getRepositoryPackageInfo(String packageName)
Get meta data for the latest version of a package from the repository
|
static org.pentaho.packageManagement.Package |
getRepositoryPackageInfo(String packageName,
String version)
Get meta data for a specific version of a package from the repository
|
static List<Object> |
getRepositoryPackageVersions(String packageName)
Get the versions of the supplied package available on the server
|
static org.pentaho.packageManagement.PackageManager |
getUnderlyingPackageManager()
Get the underlying package manager implementation
|
static boolean |
installedPackageResourceExists(String packageName,
String resourceName)
Check if a named resource exists in an installed package
|
static String |
installPackageFromArchive(String packageArchivePath,
PrintStream... progress)
Install a package from an archive
|
static boolean |
installPackageFromRepository(String packageName,
String version,
PrintStream... progress)
Install a named package by retrieving the location of the archive from the
meta data stored in the repository
|
static String |
installPackageFromURL(URL packageURL,
PrintStream... progress)
Insstall a package from the supplied URL
|
static boolean |
installPackages(List<org.pentaho.packageManagement.Package> toInstall,
PrintStream... progress)
Install the supplied list of packages
|
static boolean |
loadCheck(org.pentaho.packageManagement.Package toLoad,
File packageRoot,
PrintStream... progress)
Check whether a package should be loaded or not.
|
static void |
loadPackages(boolean verbose)
Load all packages
|
static void |
loadPackages(boolean verbose,
boolean avoidTriggeringFullClassDiscovery,
boolean refreshGOEProperties)
Load all packages
|
static void |
main(String[] args)
Main method for using the package manager from the command line
|
static org.pentaho.packageManagement.Package |
mostRecentVersionWithRespectToConstraint(org.pentaho.packageManagement.PackageConstraint toCheck)
Find the most recent version of the package encapsulated in the supplied
PackageConstraint argument that satisfies the constraint
|
static int |
numRepositoryPackages()
Get the number of packages that are available at the repository.
|
static Exception |
refreshCache(PrintStream... progress)
Refresh the local copy of the package meta data
|
static void |
refreshGOEProperties()
Refresh the generic object editor properties via re-running of the dynamic
class discovery process.
|
static void |
removeExplorerProps(String installedPackageName)
Remove any ExplorerDefaults properties specified in the supplied package
|
static int |
repoZipArchiveSize()
Retrieves the size (in KB) of the repository zip archive stored on the
server.
|
static List<String> |
toggleLoadStatus(List<String> packageNames)
Toggle the load status of the supplied list of package names
|
static void |
uninstallPackage(String packageName,
boolean updateKnowledgeFlow,
PrintStream... progress)
Uninstall a named package
|
public static File WEKA_HOME
public static File PACKAGES_DIR
public static File PROPERTIES_DIR
public static boolean m_offline
public static boolean m_initialPackageLoadingInProcess
public static boolean m_noPackageMetaDataAvailable
public static void removeExplorerProps(String installedPackageName)
installedPackageName - the package specifying properties that should
be removed from ExplorerDefaultspublic static boolean loadCheck(org.pentaho.packageManagement.Package toLoad,
File packageRoot,
PrintStream... progress)
toLoad - the package to checkpackageRoot - the root directory of the packageprogress - for reporting loading progresspublic static boolean checkForUnsetEnvVar(org.pentaho.packageManagement.Package toLoad,
PrintStream... progress)
toLoad - the package to checkpublic static boolean checkForMissingClasses(org.pentaho.packageManagement.Package toLoad,
PrintStream... progress)
toLoad - the package to checkpublic static boolean checkForMissingFiles(org.pentaho.packageManagement.Package toLoad,
File packageRoot,
PrintStream... progress)
toLoad - the package to checkpackageRoot - the root directory of the packagepublic static List<String> toggleLoadStatus(List<String> packageNames) throws Exception
packageNames - the packages to toggle the load status forException - if a problem occurspublic static void loadPackages(boolean verbose)
verbose - true if loading progress should be outputpublic static void loadPackages(boolean verbose,
boolean avoidTriggeringFullClassDiscovery,
boolean refreshGOEProperties)
verbose - true if loading progress should be outputavoidTriggeringFullClassDiscovery - true if we should avoid processing
any properties files that might cause a full class discovery run,
and may involve instantiating GUI classes.refreshGOEProperties - true if the GOE properties should be refreshed
after loading (i.e. a re-run of the class discovery mechanism,
re-initialization of the Knowledge Flow etc.)public static void refreshGOEProperties()
public static org.pentaho.packageManagement.PackageManager getUnderlyingPackageManager()
public static int repoZipArchiveSize()
public static int numRepositoryPackages()
public static Map<String,String> getPackageList(boolean local)
local - true if the local package list in the cache should be read
rather than the online repositorypublic static Exception establishCacheIfNeeded(PrintStream... progress)
progress - for reporting progresspublic static Exception checkForNewPackages(PrintStream... progress)
progress - to report progress topublic static Exception refreshCache(PrintStream... progress)
progress - to report progress topublic static boolean installedPackageResourceExists(String packageName, String resourceName)
packageName - the name of the package in questionresourceName - the name of the resource to check forpublic static File getPackageHome()
public static org.pentaho.packageManagement.Package mostRecentVersionWithRespectToConstraint(org.pentaho.packageManagement.PackageConstraint toCheck)
throws Exception
toCheck - the PackageConstraint containing the package in questionException - if a version can't be found that satisfies the constraint
or an error occurs while communicating with the respositorypublic static boolean installPackages(List<org.pentaho.packageManagement.Package> toInstall, PrintStream... progress) throws Exception
toInstall - packages to installprogress - to report progress toException - if a problem occurspublic static List<Object> getRepositoryPackageVersions(String packageName) throws Exception
packageName - the package name to get available versions forException - if a problem occurspublic static URL getPackageRepositoryURL()
public static List<org.pentaho.packageManagement.Package> getAllPackages() throws Exception
Exception - if a problem occurspublic static List<org.pentaho.packageManagement.Package> getAvailablePackages() throws Exception
Exception - if a problem occurspublic static List<org.pentaho.packageManagement.Package> getAvailableCompatiblePackages() throws Exception
Exception - if a problem occurspublic static List<org.pentaho.packageManagement.Package> getInstalledPackages() throws Exception
Exception - if a problem occurspublic static List<org.pentaho.packageManagement.Dependency> getAllDependenciesForPackage(org.pentaho.packageManagement.Package target, Map<String,List<org.pentaho.packageManagement.Dependency>> conflicts) throws Exception
target - the package to get the dependencies forconflicts - will hold any conflictsException - if a problem occurspublic static org.pentaho.packageManagement.Package getPackageArchiveInfo(String packageArchivePath) throws Exception
packageArchivePath - the path to the package archiveException - if a problem occurspublic static org.pentaho.packageManagement.Package getInstalledPackageInfo(String packageName) throws Exception
packageName - the name of the packageException - if a problem occurspublic static org.pentaho.packageManagement.Package getRepositoryPackageInfo(String packageName) throws Exception
packageName - the name of the packageException - if a problem occurspublic static org.pentaho.packageManagement.Package getRepositoryPackageInfo(String packageName, String version) throws Exception
packageName - the name of the packageversion - the version to get meta data forException - if a problem occurspublic static boolean installPackageFromRepository(String packageName, String version, PrintStream... progress) throws Exception
packageName - the name of the package to installversion - the version of the package to installprogress - for reporting progressException - if a problem occurspublic static String installPackageFromArchive(String packageArchivePath, PrintStream... progress) throws Exception
packageArchivePath - the path to the package archive file to installprogress - for reporting progressException - if a problem occurspublic static String installPackageFromURL(URL packageURL, PrintStream... progress) throws Exception
packageURL - the URL to the package archive to installprogress - for reporting progressException - if a problem occurspublic static void uninstallPackage(String packageName, boolean updateKnowledgeFlow, PrintStream... progress) throws Exception
packageName - the name of the package to removeupdateKnowledgeFlow - true if any Knowledge Flow beans provided by the
package should be deregistered from the KnoweledgeFlowprogress - for reporting progressException - if a problem occurspublic static void main(String[] args)
args - command line argumentsCopyright © 2014 University of Waikato, Hamilton, NZ. All Rights Reserved.