org.xwiki.extension.handler
Interface ExtensionHandler


@Role
public interface ExtensionHandler

Handle extension related tasks depending of the type (install, uninstall, etc...).

Since:
4.0M1
Version:
$Id: 72b51d74a1b6e662af73ebe564d18d664f6030dd $

Method Summary
 void checkInstall(Extension extension, String namespace, Request request)
          Check if installing the passed extension is allowed.
 void checkUninstall(InstalledExtension extension, String namespace, Request request)
          Check if uninstalling the passed extension is allowed.
 void initialize(LocalExtension localExtension, String namespace)
          Initialize the provided local extension (during application startup, re-initialization...).
 void install(LocalExtension localExtension, String namespace, Request request)
          Install the provided local extension.
 void uninstall(LocalExtension localExtension, String namespace, Request request)
          Uninstall the provided local extension.
 void upgrade(LocalExtension previousLocalExtension, LocalExtension newLocalExtension, String namespace, Request request)
          Upgrade the provided local extension.
 

Method Detail

install

void install(LocalExtension localExtension,
             String namespace,
             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(LocalExtension localExtension,
               String namespace,
               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

upgrade

void upgrade(LocalExtension previousLocalExtension,
             LocalExtension newLocalExtension,
             String namespace,
             Request request)
             throws InstallException
Upgrade the provided local extension.

Parameters:
previousLocalExtension - the previous installed version 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

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,
                  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,
                    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


Copyright © 2004-2013 XWiki. All Rights Reserved.