Interface ModuleTypeDetector

All Known Implementing Classes:
DefaultModuleTypeDetector

public interface ModuleTypeDetector
Interface for detecting the type of eLearning module.

This interface defines the contract for classes that detect the type of eLearning module based on the files present in the file system. Implementations should examine the structure and manifest files of the module to determine its type.

The detection process typically uses a plugin system where each plugin is responsible for detecting a specific module type. Plugins are called in order of priority until one of them successfully detects a module type.

  • Method Details

    • registerPlugin

      void registerPlugin(ModuleTypeDetectorPlugin plugin)
      Registers a module type detector plugin.
      Parameters:
      plugin - the plugin to register
      Throws:
      IllegalArgumentException - if the plugin is null
    • unregisterPlugin

      boolean unregisterPlugin(ModuleTypeDetectorPlugin plugin)
      Unregisters a module type detector plugin.
      Parameters:
      plugin - the plugin to unregister
      Returns:
      true if the plugin was unregistered, false if it wasn't registered
      Throws:
      IllegalArgumentException - if the plugin is null
    • getPlugins

      Returns an unmodifiable list of the registered plugins.
      Returns:
      an unmodifiable list of the registered plugins
    • detectModuleType

      ModuleType detectModuleType() throws ModuleDetectionException
      Detects the type of eLearning module based on the files present in the file system.

      This method calls each registered plugin in order of priority until one of them successfully detects a module type.

      Returns:
      the detected ModuleType
      Throws:
      ModuleDetectionException - if the module type cannot be detected, or if there's an error during the detection process