com.atlassian.jira.plugin
Interface PluginInstallationManager

All Known Implementing Classes:
DefaultPluginInstallationManager

public interface PluginInstallationManager

This is used to manage installable plugins. Installable plugins are plugins that can be scheduled to be installed, uninstalled, or upgraded during JIRAs next startup process. TODO: It would probably be better if this interface extended the PluginController interface and the JiraPluginManager was broken up to remove the use of the deprecated PluginManager interface.

Since:
v3.13

Method Summary
 void cancelPluginUpdate(String key)
          Cancel any scheduled changes - install, upgrade or uninstall - for the plugin identified by the key.
 void configurePluginPath(String pluginsPath)
          Configure the manager to store installed, pending, and uninstalled plugins under the given path.
 com.atlassian.plugin.loaders.PluginLoader getInstalledPluginsLoader()
           
 String installPlugin(com.atlassian.plugin.PluginJar pluginJar, com.atlassian.plugin.PluginAccessor pluginAccessor)
          Schedule the plugin to be installed or upgraded, if it is a newer version of a plugin that is already installed, during the next startup cycle.
 boolean isConfigured()
           
 void processUpdates()
          This method is to be called during the JIRA startup process.
 void uninstall(com.atlassian.plugin.Plugin plugin)
          Schedule the plugin to be uninstalled during the next startup cycle.
 

Method Detail

isConfigured

boolean isConfigured()
Returns:
true if the manager has been configured with a plugin path, false otherwise. The manager can be configured by calling the configurePluginPath() method.

configurePluginPath

void configurePluginPath(String pluginsPath)
Configure the manager to store installed, pending, and uninstalled plugins under the given path. After this method is called, the methods for scheduling plugins changes can be used.

Parameters:
pluginsPath - path to store plugin jars under

installPlugin

String installPlugin(com.atlassian.plugin.PluginJar pluginJar,
                     com.atlassian.plugin.PluginAccessor pluginAccessor)
                     throws com.atlassian.plugin.PluginParseException
Schedule the plugin to be installed or upgraded, if it is a newer version of a plugin that is already installed, during the next startup cycle.

Parameters:
pluginJar - Plugin jar to be installed.
pluginAccessor - Plugin accessor to determine if the pluginJar is a newer version of an already installed plugin
Returns:
Plugin key retrieved from the plugin metadata.
Throws:
com.atlassian.plugin.PluginParseException - Thrown if the pluginJar cannot be opened or if it does not contain plugin metadata or the plugin metadata is in an invalid format.

uninstall

void uninstall(com.atlassian.plugin.Plugin plugin)
               throws com.atlassian.plugin.PluginException
Schedule the plugin to be uninstalled during the next startup cycle.

Parameters:
plugin - Plugin to be uninstalled
Throws:
com.atlassian.plugin.PluginException - if the plugin cannot be uninstalled

cancelPluginUpdate

void cancelPluginUpdate(String key)
Cancel any scheduled changes - install, upgrade or uninstall - for the plugin identified by the key.

Parameters:
key - Key of the plugin for which updates should be cancelled.

getInstalledPluginsLoader

com.atlassian.plugin.loaders.PluginLoader getInstalledPluginsLoader()
Returns:
If this manager is configured, returns a PluginLoader that scans the installed plugins directory. Otherwise, returns a PluginLoader that doesn't do any scanning or discovery of plugins.

processUpdates

void processUpdates()
                    throws com.atlassian.plugin.PluginException
This method is to be called during the JIRA startup process. It causes all pending changes to be made and must be called before the PluginManager is started so that newly installed/upgrade plugins will be available for loading and any uninstalled plugins will not be loaded.

Throws:
com.atlassian.plugin.PluginException - Thrown if there is a problem with installing/upgrading/uninstalling one of the plugins


Copyright © 2002-2009 Atlassian. All Rights Reserved.