Interface ExtensionHandler


  • @Role
    public interface ExtensionHandler
    Handle extension related tasks depending of the type (install, uninstall, etc...).
    Since:
    4.0M1
    Version:
    $Id: d9c3dd8352957f07c51a9b1f24eae1df42764aea $
    • Method Detail

      • install

        void install​(LocalExtension localExtension,
                     String namespace,
                     org.xwiki.job.Request request)
              throws InstallException
        Install the provided local extension.
        Parameters:
        localExtension - the extension to install
        namespace - the namespace where to install the extension
        request - extra parameters
        Throws:
        InstallException - error when trying to install the extension
      • uninstall

        void uninstall​(InstalledExtension localExtension,
                       String namespace,
                       org.xwiki.job.Request request)
                throws UninstallException
        Uninstall the provided local extension.
        Parameters:
        localExtension - the extension to uninstall
        namespace - the namespace from where to uninstall the extension
        request - extra parameters
        Throws:
        UninstallException - error when trying to uninstall the extension
        Since:
        5.0RC1
      • upgrade

        void upgrade​(Collection<InstalledExtension> previousLocalExtensions,
                     LocalExtension newLocalExtension,
                     String namespace,
                     org.xwiki.job.Request request)
              throws InstallException
        Upgrade the provided local extension.
        Parameters:
        previousLocalExtensions - the previous installed versions of the extension
        newLocalExtension - the extension to install
        namespace - the namespace from where to uninstall the extension
        request - extra parameters
        Throws:
        InstallException - error when trying to upgrade the extension
        Since:
        5.0RC1
      • initialize

        void initialize​(LocalExtension localExtension,
                        String namespace)
                 throws ExtensionException
        Initialize the provided local extension (during application startup, re-initialization...).
        Parameters:
        localExtension - the extension to install
        namespace - the namespace where to install the extension
        Throws:
        ExtensionException - error when trying to install the extension
      • checkInstall

        void checkInstall​(Extension extension,
                          String namespace,
                          org.xwiki.job.Request request)
                   throws InstallException
        Check if installing the passed extension is allowed.

        It is generally used to do some non generic checking of whether or not it is possible to install the passed extension (not the right environment, not enough rights, etc.).

        Parameters:
        extension - the extension to install
        namespace - the namespace from where to install
        request - extra parameters
        Throws:
        InstallException - installing the extension will fail
        Since:
        4.2M2
      • checkUninstall

        void checkUninstall​(InstalledExtension extension,
                            String namespace,
                            org.xwiki.job.Request request)
                     throws UninstallException
        Check if uninstalling the passed extension is allowed.

        It is generally used to do some non generic checking of whether or not it is possible to uninstall the passed extension (not the right environment, not enough rights, etc.).

        Parameters:
        extension - the extension to uninstall
        namespace - the namespace from where to uninstall
        request - extra parameters
        Throws:
        UninstallException - uninstalling the extension will fail
        Since:
        4.2M2