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)
Adds a the URI of a bundle that contains some packages to install.
|
void |
addBundle(URL bundleURL)
Adds a URL of a bundle that contains some packages to install.
|
void |
addBundlesFromDirectory(File directory)
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.
|
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 |
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
InstallPackageService.addBundle(File)
or the
InstallPackageService.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
InstallPackageService.addBundle(File)
or the
InstallPackageService.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
InstallPackageService.addBundle(File)
or the InstallPackageService.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
InstallPackageService.addBundle(File)
or the InstallPackageService.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) 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) 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) 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
InstallPackageService.addBundle(File)
or the
InstallPackageService.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 List<String> getCategories()
InstallPackageService
getCategories
in interface InstallPackageService
public List<String> getTypes()
InstallPackageService
getTypes
in interface InstallPackageService