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 voidendTransaction()Clears all recorded method all calls.com.bc.ceres.swing.update.ModuleItem[]getAvailableModuleItems()Retrieves the list ofmodule itemswhich 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.ProxyConfiggetProxyConfig()Gets the proxy configuration.Module[]getRepositoryModules(ProgressMonitor pm)Retrieves the list ofmoduleson the repository.URLgetRepositoryUrl()Retrieves the repository url.com.bc.ceres.swing.update.ModuleItem[]getUpdatableModuleItems()Retrieves the list of localmodule itemswhich can be updated by modules from the repository.ModuleinstallModule(Module newModule, ProgressMonitor pm)Performs an installation of a new module.voidrollbackTransaction()Makes all recorded method calls undone.voidsetProxyConfig(ProxyConfig proxyConfig)voidsetRepositoryUrl(URL repositoryUrl)voidstartTransaction()After calling this method all calls toinstallModule(),updateModule()anduninstallModule()are recorded.voidsynchronizeWithRepository(ProgressMonitor pm)Synchronizes the this module manager with the specified repository.voiduninstallModule(Module oldModule, ProgressMonitor pm)* Performs an uninstallation of an existing module.ModuleupdateModule(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:ModuleManagerRetrieves the repository url.- Specified by:
getRepositoryUrlin interfaceModuleManager- Returns:
- An url which points to the module repository, might be
nullif not already set.
-
setRepositoryUrl
public void setRepositoryUrl(URL repositoryUrl)
-
getProxyConfig
public ProxyConfig getProxyConfig()
Description copied from interface:ModuleManagerGets the proxy configuration.- Specified by:
getProxyConfigin interfaceModuleManager- Returns:
- A configuration used when the connection uses a proxy, might be
nullif not already set.
-
setProxyConfig
public void setProxyConfig(ProxyConfig proxyConfig)
-
getInstalledModules
public Module[] getInstalledModules()
Description copied from interface:ModuleManagerRetrieves the list of locally installedmodules.- Specified by:
getInstalledModulesin interfaceModuleManager- Returns:
- An array of locally installed modules.
-
getRepositoryModules
public Module[] getRepositoryModules(ProgressMonitor pm) throws CoreException
Description copied from interface:ModuleManagerRetrieves the list ofmoduleson the repository.- Specified by:
getRepositoryModulesin 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:ModuleManagerRetrieves the list of locally installedmodule items.- Specified by:
getInstalledModuleItemsin interfaceModuleManager- Returns:
- An array of locally installed modules.
-
getUpdatableModuleItems
public com.bc.ceres.swing.update.ModuleItem[] getUpdatableModuleItems()
Description copied from interface:ModuleManagerRetrieves the list of localmodule itemswhich can be updated by modules from the repository. Will return an empty array untilModuleManager.synchronizeWithRepository(ProgressMonitor)is called.- Specified by:
getUpdatableModuleItemsin interfaceModuleManager- Returns:
- An array of updatable modules.
-
getAvailableModuleItems
public com.bc.ceres.swing.update.ModuleItem[] getAvailableModuleItems()
Description copied from interface:ModuleManagerRetrieves the list ofmodule itemswhich can be installed from the repository. Will return an empty array untilModuleManager.synchronizeWithRepository(ProgressMonitor)is called.- Specified by:
getAvailableModuleItemsin interfaceModuleManager- Returns:
- An array of available modules.
-
synchronizeWithRepository
public void synchronizeWithRepository(ProgressMonitor pm) throws CoreException
Description copied from interface:ModuleManagerSynchronizes the this module manager with the specified repository.- Specified by:
synchronizeWithRepositoryin interfaceModuleManager- Parameters:
pm- Can be used to indicate progress- Throws:
CoreException- It is thrown if therepository urlis not set or an IO-Error occures.
-
installModule
public Module installModule(Module newModule, ProgressMonitor pm) throws CoreException
Description copied from interface:ModuleManagerPerforms an installation of a new module.- Specified by:
installModulein 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:ModuleManagerPerforms an update to a higher version of an existing module.- Specified by:
updateModulein 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:
uninstallModulein 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:ModuleManagerAfter calling this method all calls toinstallModule(),updateModule()anduninstallModule()are recorded.- Specified by:
startTransactionin interfaceModuleManager- See Also:
ModuleManager.endTransaction(),ModuleManager.rollbackTransaction()
-
endTransaction
public void endTransaction()
Description copied from interface:ModuleManagerClears all recorded method all calls.- Specified by:
endTransactionin interfaceModuleManager- See Also:
ModuleManager.startTransaction(),ModuleManager.rollbackTransaction()
-
rollbackTransaction
public void rollbackTransaction()
Description copied from interface:ModuleManagerMakes all recorded method calls undone.- Specified by:
rollbackTransactionin interfaceModuleManager- See Also:
ModuleManager.startTransaction(),ModuleManager.endTransaction()
-
-