public class DefaultInstallPackageService extends Thread implements InstallPackageService
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
DefaultInstallPackageService(DefaultInstallerManager manager) |
Modifier and Type | Method and Description |
---|---|
void |
addBundle(File bundle,
SimpleTaskStatus taskStatus)
Adds a the URI of a bundle that contains some packages to install.
|
void |
addBundle(URL bundleURL,
SimpleTaskStatus taskStatus)
Adds a URL of a bundle that contains some packages to install.
|
void |
addBundlesFromDirectory(File directory,
SimpleTaskStatus taskStatus)
In reads a directory and reads all the bundles.
|
void |
downloadPackage(PackageInfo packageInfo) |
void |
downloadPackage(PackageInfo packageInfo,
SimpleTaskStatus taskStatus)
Download the package and register it in the manager.
|
List<String> |
getCategories()
Gets the list of all the categories of *all* the packages.
|
List<String> |
getDefaultSelectedPackagesIDs() |
Manager |
getManager()
Returns a reference to the
Manager which manages this server. |
int |
getPackageCount() |
PackageInfo |
getPackageInfo(int index)
Return the package information for a concrete position.
|
PackageInfo |
getPackageInfo(String packageCode)
Return the package information for a concrete position.
|
Properties |
getProperties()
Get the proprties associates to this bundle.
|
List<String> |
getTypes()
Gets the list of different the types of *all* the packages.
|
void |
installPackage(File applicationDirectory,
PackageInfo packageInfo)
Install a package in a concrete gvSIG installation directory.
|
void |
installPackage(File applicationDirectory,
String packageCode)
Install a package in a concrete gvSIG installation directory.
|
void |
installPackageProviders(SimpleTaskStatus taskStatus) |
boolean |
needInstallPackageProviders() |
void |
reset() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public DefaultInstallPackageService(DefaultInstallerManager manager)
public void reset()
reset
in interface InstallPackageService
public void installPackage(File applicationDirectory, PackageInfo packageInfo) throws InstallPackageServiceException
InstallPackageService
#addBundle(File)
or the
#addBundlesFromDirectory(File)
method.installPackage
in interface InstallPackageService
applicationDirectory
- a valid root directory where an instance og gvSIG is
installed.packageInfo
- the package to install.InstallPackageServiceException
- If there is an error installing the package.public void installPackage(File applicationDirectory, String packageCode) throws InstallPackageServiceException
InstallPackageService
#addBundle(File)
or the
#addBundlesFromDirectory(File)
method.installPackage
in interface InstallPackageService
applicationDirectory
- a valid root directory where an instance og gvSIG is
installed.packageCode
- the code of the package.InstallPackageServiceException
- if there is an error installing the PackageInfo#
public PackageInfo getPackageInfo(int index)
InstallPackageService
#addBundle(File)
or the #addBundlesFromDirectory(File)
method.getPackageInfo
in interface InstallPackageService
index
- the position of the package.null
if the
package doesn't exist.public PackageInfo getPackageInfo(String packageCode)
InstallPackageService
#addBundle(File)
or the #addBundlesFromDirectory(File)
method.getPackageInfo
in interface InstallPackageService
packageCode
- the code of the package.null
if the
package doesn't exist.public void addBundle(File bundle, SimpleTaskStatus taskStatus) throws InstallPackageServiceException
InstallPackageService
InstallerManager
class.addBundle
in interface InstallPackageService
InstallPackageServiceException
- it is thrown if there is an exception reading the URI.public void addBundle(URL bundleURL, SimpleTaskStatus taskStatus) throws InstallPackageServiceException
InstallPackageService
InstallerManager
class.addBundle
in interface InstallPackageService
bundleURL
- the URL
of a bundle.InstallPackageServiceException
- it is thrown if there is an exception reading the URL
.public void addBundlesFromDirectory(File directory, SimpleTaskStatus taskStatus) throws InstallPackageServiceException
InstallPackageService
addBundlesFromDirectory
in interface InstallPackageService
directory
- a directory that contains bundles.InstallPackageServiceException
- If there is any problem reading the directory of bundles.public int getPackageCount()
getPackageCount
in interface InstallPackageService
#addBundle(File)
or the
#addBundlesFromDirectory(File)
method.public Manager getManager()
Service
Manager
which manages this server.getManager
in interface Service
Manager
public void downloadPackage(PackageInfo packageInfo) throws InstallPackageServiceException
InstallPackageServiceException
public void downloadPackage(PackageInfo packageInfo, SimpleTaskStatus taskStatus) throws InstallPackageServiceException
InstallPackageService
downloadPackage
in interface InstallPackageService
InstallPackageServiceException
public List<String> getDefaultSelectedPackagesIDs()
getDefaultSelectedPackagesIDs
in interface InstallPackageService
public Properties getProperties()
InstallPackageService
getProperties
in interface InstallPackageService
public List<String> getCategories()
InstallPackageService
getCategories
in interface InstallPackageService
public List<String> getTypes()
InstallPackageService
getTypes
in interface InstallPackageService
public boolean needInstallPackageProviders()
needInstallPackageProviders
in interface InstallPackageService
public void installPackageProviders(SimpleTaskStatus taskStatus)
installPackageProviders
in interface InstallPackageService