1 package com.atlassian.plugin;
2
3 /**
4 * Interface to control the state of the plugin system
5 */
6 public interface PluginController
7 {
8 /**
9 * Enable a plugin by key.
10 */
11 void enablePlugin(String key);
12
13 /**
14 * Disable a plugin by key.
15 */
16 void disablePlugin(String key);
17
18 /**
19 * Enable a plugin module by key.
20 */
21 void enablePluginModule(String completeKey);
22
23 /**
24 * Disable a plugin module by key.
25 */
26 void disablePluginModule(String completeKey);
27
28 /**
29 * Installs a plugin and returns the plugin key
30 * @throws com.atlassian.plugin.PluginParseException if the plugin is not a valid plugin
31 */
32 String installPlugin(PluginArtifact pluginArtifact) throws PluginParseException;
33
34 /**
35 * Uninstall the plugin, disabling it first.
36 * @throws PluginException if there was some problem uninstalling the plugin.
37 */
38 void uninstall(Plugin plugin) throws PluginException;
39
40 /**
41 * Search all loaders and add any new plugins you find.
42 * @return The number of new plugins found.
43 */
44 int scanForNewPlugins() throws PluginParseException;
45 }