Interface ModuleManager


  • public interface ModuleManager
    Manages how modules are installed, restarted, and removed from Ignition
    • Method Detail

      • getGatewayModules

        java.util.List<GatewayModule> getGatewayModules()
        Returns a list of all modules that have Gateway-scope hooks
      • getModuleCount

        int getModuleCount()
        The total count of modules currently installed
      • getModules

        java.util.List<GatewayModule> getModules()
        Returns a list of all modules
      • getModule

        GatewayModule getModule​(java.lang.String id)
        Finds a module with the given id string. Case sensitive. Will return null if the module is not found.
      • resolveClass

        java.lang.Class<?> resolveClass​(java.lang.String className)
        Loops through each module's classloader, giving it a chance to resolve the given class.
      • getMenuVersion

        java.util.UUID getMenuVersion()
        Returns:
        a UUID representing the state of the config and status menus. This UUID will change when it's possible that the menu has been updated, either when a gateway-scope module has changed or somebody calls
      • uninstallModule

        void uninstallModule​(java.lang.String moduleId)
                      throws java.lang.Exception
        Uninstalls the given module. Any dependent modules will be restarted afterwards.
        Throws:
        java.lang.Exception
      • restartModule

        void restartModule​(java.lang.String moduleId)
                    throws java.lang.Exception
        Restarts the given module. Any dependent modules will first be shut down, and then restarted afterwards.
        Throws:
        java.lang.Exception
      • installModule

        void installModule​(java.lang.String filename,
                           byte[] bytes)
                    throws java.lang.Exception
        Installs a new module.
        Parameters:
        filename - The desired filename for the new module, like "MyModule.modl"
        bytes - The *.modl file, as a byte array.
        Throws:
        java.lang.Exception - if anything went wrong attempting to decode or install the module
      • installModule

        void installModule​(java.lang.String filename,
                           java.io.File tempModuleLocation)
                    throws java.lang.Exception
        Installs a new module.
        Parameters:
        filename - The desired filename for the new module, like "MyModule.modl"
        tempModuleLocation - The *.modl file, as a file located in a temp directory.
        Throws:
        java.lang.Exception - if anything went wrong attempting to decode or install the module
      • addModuleObserver

        void addModuleObserver​(ModuleObserver observer)
        Register a ModuleObserver that gets notified when modules are added.
        Parameters:
        observer - The observer to register.
      • removeModuleObserver

        void removeModuleObserver​(ModuleObserver observer)
        Remove a previously registered ModuleObserver.
        Parameters:
        observer - The observer to unregister.