org.jtheque.core.managers.module
Interface IModuleManager

All Known Implementing Classes:
ModuleManager

public interface IModuleManager

A module manager. It seems a manager who's responsible for loading and managing the different modules of the application.

Author:
Baptiste Wicht

Method Summary
 void addModuleListener(ModuleListener listener)
          Add a module listener.
 java.lang.String canModuleLaunched(ModuleContainer module)
          Test if a module can ben launched.
 void choosePrimaryModule()
          Choose the primary module to launch.
 void disableModule(ModuleContainer module)
          Disable the module.
 void enableModule(ModuleContainer module)
          Enable a module.
 ModuleContainer getModule(java.lang.String name)
          Return the module with the name.
 java.util.Collection<ModuleContainer> getModules()
          Return all the modules.
 java.util.List<ModuleDescription> getModulesFromRepository()
          Return all the modules of the application repository.
 ModuleContainer getPrimaryModule()
          Return the current primary module.
 java.util.List<ModuleContainer> getPrimaryModules()
          Return all the primary modules.
 Repository getRepository()
          Return the repository of the application.
 void install(java.lang.String versionsFileURL)
          Install the module from the versions file.
 boolean installModule(java.io.File file)
          Install the module of the file.
 boolean isCollectionModule()
          Indicate if the primary module is collection based.
 boolean isInstalled(java.lang.String module)
          Test if the module is installed.
 void launchPrimaryModule()
          Launch the primary module.
 void loadModule(ModuleContainer module)
          Load the module.
 boolean plugCollection(java.lang.String collection, java.lang.String password, boolean create)
          Plug the collection.
 void plugModules()
          Plug the modules.
 void prePlugModules()
          Preplug the modules.
 void removeModuleListener(ModuleListener listener)
          Remove a module listener.
 void setPrimaryModule(ModuleContainer module)
          Set the primary module.
 void switchPrimaryModule()
          Switch the primary module.
 void uninstallModule(ModuleContainer module)
          Uninstall the module.
 void unplugModules()
          Unplug the modules.
 

Method Detail

getPrimaryModule

ModuleContainer getPrimaryModule()
Return the current primary module.

Returns:
The primary module.

getModules

java.util.Collection<ModuleContainer> getModules()
Return all the modules.

Returns:
All the modules.

getPrimaryModules

java.util.List<ModuleContainer> getPrimaryModules()
Return all the primary modules.

Returns:
All the primary mmodules.

addModuleListener

void addModuleListener(ModuleListener listener)
Add a module listener.

Parameters:
listener - The listener to add.

removeModuleListener

void removeModuleListener(ModuleListener listener)
Remove a module listener.

Parameters:
listener - The listener to remove.

getModulesFromRepository

java.util.List<ModuleDescription> getModulesFromRepository()
Return all the modules of the application repository.

Returns:
all the modules of the application repository.

getRepository

Repository getRepository()
Return the repository of the application.

Returns:
The Repository.

isInstalled

boolean isInstalled(java.lang.String module)
Test if the module is installed.

Parameters:
module - The module name.
Returns:
true if the module is installed.

getModule

ModuleContainer getModule(java.lang.String name)
Return the module with the name.

Parameters:
name - The name of the module.
Returns:
The module.

install

void install(java.lang.String versionsFileURL)
Install the module from the versions file.

Parameters:
versionsFileURL - The URL of the versions file.

choosePrimaryModule

void choosePrimaryModule()
Choose the primary module to launch.


unplugModules

void unplugModules()
Unplug the modules.


enableModule

void enableModule(ModuleContainer module)
Enable a module.

Parameters:
module - The module to enable.

prePlugModules

void prePlugModules()
Preplug the modules.


plugModules

void plugModules()
Plug the modules.


disableModule

void disableModule(ModuleContainer module)
Disable the module.

Parameters:
module - The module to disable.

installModule

boolean installModule(java.io.File file)
Install the module of the file.

Parameters:
file - The file of the module.
Returns:
true if the module has been installed else false.

uninstallModule

void uninstallModule(ModuleContainer module)
Uninstall the module.

Parameters:
module - The module to uninstall.

canModuleLaunched

java.lang.String canModuleLaunched(ModuleContainer module)
Test if a module can ben launched.

Parameters:
module - The module to be launched.
Returns:
The error message. If the error is empty, the module can be launched.

loadModule

void loadModule(ModuleContainer module)
Load the module.

Parameters:
module - The module to load.

launchPrimaryModule

void launchPrimaryModule()
Launch the primary module.


setPrimaryModule

void setPrimaryModule(ModuleContainer module)
Set the primary module.

Parameters:
module - The module to set as primary.

switchPrimaryModule

void switchPrimaryModule()
Switch the primary module.


isCollectionModule

boolean isCollectionModule()
Indicate if the primary module is collection based.

Returns:
true if the primary module is collection based else false.

plugCollection

boolean plugCollection(java.lang.String collection,
                       java.lang.String password,
                       boolean create)
Plug the collection.

Parameters:
collection - The collection to use.
password - The password of the collection.
create - A boolea flag indicating if we must create the collection or not.
Returns:
true if the process has been correctly effectued else false.


Copyright © 2009 JTheque. All Rights Reserved.