Package com.bc.ceres.swing.update
Class DefaultModuleManager
- java.lang.Object
-
- com.bc.ceres.swing.update.DefaultModuleManager
-
- All Implemented Interfaces:
ModuleManager
public class DefaultModuleManager extends Object implements ModuleManager
-
-
Constructor Summary
Constructors Constructor Description DefaultModuleManager()
DefaultModuleManager(ModuleContext context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
endTransaction()
Clears all recorded method all calls.com.bc.ceres.swing.update.ModuleItem[]
getAvailableModuleItems()
Retrieves the list ofmodule items
which can be installed from the repository.com.bc.ceres.swing.update.ModuleItem[]
getInstalledModuleItems()
Retrieves the list of locally installedmodule items
.Module[]
getInstalledModules()
Retrieves the list of locally installedmodules
.ProxyConfig
getProxyConfig()
Gets the proxy configuration.Module[]
getRepositoryModules(ProgressMonitor pm)
Retrieves the list ofmodules
on the repository.URL
getRepositoryUrl()
Retrieves the repository url.com.bc.ceres.swing.update.ModuleItem[]
getUpdatableModuleItems()
Retrieves the list of localmodule items
which can be updated by modules from the repository.Module
installModule(Module newModule, ProgressMonitor pm)
Performs an installation of a new module.void
rollbackTransaction()
Makes all recorded method calls undone.void
setProxyConfig(ProxyConfig proxyConfig)
void
setRepositoryUrl(URL repositoryUrl)
void
startTransaction()
After calling this method all calls toinstallModule()
,updateModule()
anduninstallModule()
are recorded.void
synchronizeWithRepository(ProgressMonitor pm)
Synchronizes the this module manager with the specified repository.void
uninstallModule(Module oldModule, ProgressMonitor pm)
* Performs an uninstallation of an existing module.Module
updateModule(Module oldModule, Module newModule, ProgressMonitor pm)
Performs an update to a higher version of an existing module.
-
-
-
Constructor Detail
-
DefaultModuleManager
public DefaultModuleManager()
-
DefaultModuleManager
public DefaultModuleManager(ModuleContext context)
-
-
Method Detail
-
getRepositoryUrl
public URL getRepositoryUrl()
Description copied from interface:ModuleManager
Retrieves the repository url.- Specified by:
getRepositoryUrl
in interfaceModuleManager
- Returns:
- An url which points to the module repository, might be
null
if not already set.
-
setRepositoryUrl
public void setRepositoryUrl(URL repositoryUrl)
-
getProxyConfig
public ProxyConfig getProxyConfig()
Description copied from interface:ModuleManager
Gets the proxy configuration.- Specified by:
getProxyConfig
in interfaceModuleManager
- Returns:
- A configuration used when the connection uses a proxy, might be
null
if not already set.
-
setProxyConfig
public void setProxyConfig(ProxyConfig proxyConfig)
-
getInstalledModules
public Module[] getInstalledModules()
Description copied from interface:ModuleManager
Retrieves the list of locally installedmodules
.- Specified by:
getInstalledModules
in interfaceModuleManager
- Returns:
- An array of locally installed modules.
-
getRepositoryModules
public Module[] getRepositoryModules(ProgressMonitor pm) throws CoreException
Description copied from interface:ModuleManager
Retrieves the list ofmodules
on the repository.- Specified by:
getRepositoryModules
in interfaceModuleManager
- Parameters:
pm
- A monitor to inform the user about progress.- Returns:
- An array of modules on the repository.
- Throws:
CoreException
- if an error occures
-
getInstalledModuleItems
public com.bc.ceres.swing.update.ModuleItem[] getInstalledModuleItems()
Description copied from interface:ModuleManager
Retrieves the list of locally installedmodule items
.- Specified by:
getInstalledModuleItems
in interfaceModuleManager
- Returns:
- An array of locally installed modules.
-
getUpdatableModuleItems
public com.bc.ceres.swing.update.ModuleItem[] getUpdatableModuleItems()
Description copied from interface:ModuleManager
Retrieves the list of localmodule items
which can be updated by modules from the repository. Will return an empty array untilModuleManager.synchronizeWithRepository(ProgressMonitor)
is called.- Specified by:
getUpdatableModuleItems
in interfaceModuleManager
- Returns:
- An array of updatable modules.
-
getAvailableModuleItems
public com.bc.ceres.swing.update.ModuleItem[] getAvailableModuleItems()
Description copied from interface:ModuleManager
Retrieves the list ofmodule items
which can be installed from the repository. Will return an empty array untilModuleManager.synchronizeWithRepository(ProgressMonitor)
is called.- Specified by:
getAvailableModuleItems
in interfaceModuleManager
- Returns:
- An array of available modules.
-
synchronizeWithRepository
public void synchronizeWithRepository(ProgressMonitor pm) throws CoreException
Description copied from interface:ModuleManager
Synchronizes the this module manager with the specified repository.- Specified by:
synchronizeWithRepository
in interfaceModuleManager
- Parameters:
pm
- Can be used to indicate progress- Throws:
CoreException
- It is thrown if therepository url
is not set or an IO-Error occures.
-
installModule
public Module installModule(Module newModule, ProgressMonitor pm) throws CoreException
Description copied from interface:ModuleManager
Performs an installation of a new module.- Specified by:
installModule
in interfaceModuleManager
- Parameters:
newModule
- The module to be installed.pm
- A monitor to inform the user about progress.- Returns:
- The installed module.
- Throws:
CoreException
- if an error occures- See Also:
ModuleManager.startTransaction()
,ModuleManager.endTransaction()
,ModuleManager.rollbackTransaction()
-
updateModule
public Module updateModule(Module oldModule, Module newModule, ProgressMonitor pm) throws CoreException
Description copied from interface:ModuleManager
Performs an update to a higher version of an existing module.- Specified by:
updateModule
in interfaceModuleManager
- Parameters:
oldModule
- The module to be replaced by an newer one.newModule
- The new module to be installed.pm
- A monitor to inform the user about progress.- Returns:
- The installed module.
- Throws:
CoreException
- if an error occures- See Also:
ModuleManager.startTransaction()
,ModuleManager.endTransaction()
,ModuleManager.rollbackTransaction()
-
uninstallModule
public void uninstallModule(Module oldModule, ProgressMonitor pm) throws CoreException
Description copied from interface:ModuleManager
* Performs an uninstallation of an existing module.- Specified by:
uninstallModule
in interfaceModuleManager
- Parameters:
oldModule
- The module to be removed.pm
- A monitor to inform the user about progress.- Throws:
CoreException
- if an error occures.- See Also:
ModuleManager.startTransaction()
,ModuleManager.endTransaction()
,ModuleManager.rollbackTransaction()
-
startTransaction
public void startTransaction()
Description copied from interface:ModuleManager
After calling this method all calls toinstallModule()
,updateModule()
anduninstallModule()
are recorded.- Specified by:
startTransaction
in interfaceModuleManager
- See Also:
ModuleManager.endTransaction()
,ModuleManager.rollbackTransaction()
-
endTransaction
public void endTransaction()
Description copied from interface:ModuleManager
Clears all recorded method all calls.- Specified by:
endTransaction
in interfaceModuleManager
- See Also:
ModuleManager.startTransaction()
,ModuleManager.rollbackTransaction()
-
rollbackTransaction
public void rollbackTransaction()
Description copied from interface:ModuleManager
Makes all recorded method calls undone.- Specified by:
rollbackTransaction
in interfaceModuleManager
- See Also:
ModuleManager.startTransaction()
,ModuleManager.endTransaction()
-
-