Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
ExtensionHandlerManager | 39 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.extension.handler; | |
21 | ||
22 | import java.util.Collection; | |
23 | ||
24 | import org.xwiki.component.annotation.Role; | |
25 | import org.xwiki.extension.ExtensionException; | |
26 | import org.xwiki.extension.InstallException; | |
27 | import org.xwiki.extension.InstalledExtension; | |
28 | import org.xwiki.extension.LocalExtension; | |
29 | import org.xwiki.extension.UninstallException; | |
30 | import org.xwiki.job.Request; | |
31 | ||
32 | /** | |
33 | * Used as proxy behind all extension handlers. | |
34 | * | |
35 | * @version $Id: dae92183d703e26f597e7609442a2c62fc41b629 $ | |
36 | * @since 4.0M1 | |
37 | */ | |
38 | @Role | |
39 | public interface ExtensionHandlerManager | |
40 | { | |
41 | /** | |
42 | * Install the provided local extension. | |
43 | * | |
44 | * @param localExtension the extension to install | |
45 | * @param namespace the namespace where to install the extension | |
46 | * @param request extra parameters | |
47 | * @throws InstallException error when trying to install the extension | |
48 | */ | |
49 | void install(LocalExtension localExtension, String namespace, Request request) throws InstallException; | |
50 | ||
51 | /** | |
52 | * Uninstall the provided local extension. | |
53 | * | |
54 | * @param localExtension the extension to uninstall | |
55 | * @param namespace the namespace from where to uninstall the extension | |
56 | * @param request extra parameters | |
57 | * @throws UninstallException error when trying to uninstall the extension | |
58 | * @deprecated since 5.0RC1 use {@link #uninstall(InstalledExtension, String, Request)} instead | |
59 | */ | |
60 | @Deprecated | |
61 | void uninstall(LocalExtension localExtension, String namespace, Request request) throws UninstallException; | |
62 | ||
63 | /** | |
64 | * Uninstall the provided local extension. | |
65 | * | |
66 | * @param localExtension the extension to uninstall | |
67 | * @param namespace the namespace from where to uninstall the extension | |
68 | * @param request extra parameters | |
69 | * @throws UninstallException error when trying to uninstall the extension | |
70 | */ | |
71 | void uninstall(InstalledExtension localExtension, String namespace, Request request) throws UninstallException; | |
72 | ||
73 | /** | |
74 | * Upgrade the provided local extension. | |
75 | * | |
76 | * @param previousLocalExtension the previous installed version of the extension | |
77 | * @param newLocalExtension the extension to install | |
78 | * @param namespace the namespace from where to uninstall the extension | |
79 | * @param request extra parameters | |
80 | * @throws InstallException error when trying to upgrade the extension | |
81 | * @deprecated since 5.0RC1 use {@link #upgrade(Collection, LocalExtension, String, Request)} instead | |
82 | */ | |
83 | @Deprecated | |
84 | void upgrade(LocalExtension previousLocalExtension, LocalExtension newLocalExtension, String namespace, | |
85 | Request request) throws InstallException; | |
86 | ||
87 | /** | |
88 | * Upgrade the provided local extension. | |
89 | * | |
90 | * @param previousLocalExtensions the previous installed versions of the extension | |
91 | * @param newLocalExtension the extension to install | |
92 | * @param namespace the namespace from where to uninstall the extension | |
93 | * @param request extra parameters | |
94 | * @throws InstallException error when trying to upgrade the extension | |
95 | */ | |
96 | void upgrade(Collection<InstalledExtension> previousLocalExtensions, LocalExtension newLocalExtension, | |
97 | String namespace, Request request) throws InstallException; | |
98 | ||
99 | /** | |
100 | * Initialize the provided local extension (during application startup, reinitialization...). | |
101 | * | |
102 | * @param localExtension the extension to install | |
103 | * @param namespace the namespace where to install the extension | |
104 | * @throws ExtensionException error when trying to initialize the extension | |
105 | */ | |
106 | void initialize(LocalExtension localExtension, String namespace) throws ExtensionException; | |
107 | } |