Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
LocalExtensionRepository | 43 | 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.repository; | |
21 | ||
22 | import java.util.Collection; | |
23 | import java.util.Map; | |
24 | ||
25 | import org.xwiki.component.annotation.Role; | |
26 | import org.xwiki.extension.Extension; | |
27 | import org.xwiki.extension.ExtensionDependency; | |
28 | import org.xwiki.extension.ExtensionId; | |
29 | import org.xwiki.extension.LocalExtension; | |
30 | import org.xwiki.extension.ResolveException; | |
31 | import org.xwiki.extension.repository.search.AdvancedSearchable; | |
32 | ||
33 | /** | |
34 | * A repository containing local extension. | |
35 | * <p> | |
36 | * That's were remote extension are stored after being downloaded and from where extension are actually installed by | |
37 | * their respective handlers. | |
38 | * | |
39 | * @version $Id: cf6259b5a2dd7681a9bbde7605f8de5e119dae81 $ | |
40 | * @since 4.0M1 | |
41 | */ | |
42 | @Role | |
43 | public interface LocalExtensionRepository extends ExtensionRepository, AdvancedSearchable | |
44 | { | |
45 | /** | |
46 | * @return the number of local extensions | |
47 | */ | |
48 | int countExtensions(); | |
49 | ||
50 | /** | |
51 | * Return extension descriptor from the repository. If the extension can't be found null is returned. | |
52 | * | |
53 | * @param extensionId the extension identifier | |
54 | * @return the found extension descriptor or null if none could be found | |
55 | * @since 4.2RC1 | |
56 | */ | |
57 | LocalExtension getLocalExtension(ExtensionId extensionId); | |
58 | ||
59 | /** | |
60 | * @return all the local extensions, an empty collection if none could be found | |
61 | */ | |
62 | Collection<LocalExtension> getLocalExtensions(); | |
63 | ||
64 | /** | |
65 | * @param id the id of the extension | |
66 | * @return the version of the extension stored in the local repository order from the upper version to the lower | |
67 | * version | |
68 | */ | |
69 | Collection<LocalExtension> getLocalExtensionVersions(String id); | |
70 | ||
71 | /** | |
72 | * Store provided extension (generally a remote extension) in the local repository. | |
73 | * | |
74 | * @param extension the extension to store | |
75 | * @return the new local extension | |
76 | * @throws LocalExtensionRepositoryException error when trying store provided extension in the local repository | |
77 | */ | |
78 | LocalExtension storeExtension(Extension extension) throws LocalExtensionRepositoryException; | |
79 | ||
80 | /** | |
81 | * @param localExtension the local extension to modify | |
82 | * @param properties the properties to set | |
83 | * @throws LocalExtensionRepositoryException error when trying to save the extension change | |
84 | */ | |
85 | void setProperties(LocalExtension localExtension, Map<String, Object> properties) | |
86 | throws LocalExtensionRepositoryException; | |
87 | ||
88 | /** | |
89 | * Remove extension from local repository. | |
90 | * | |
91 | * @param extension the extension to remove | |
92 | * @throws ResolveException error when trying to find provided extension | |
93 | */ | |
94 | void removeExtension(LocalExtension extension) throws ResolveException; | |
95 | ||
96 | // ExtensionRepository | |
97 | ||
98 | @Override | |
99 | LocalExtension resolve(ExtensionDependency extensionDependency) throws ResolveException; | |
100 | ||
101 | @Override | |
102 | LocalExtension resolve(ExtensionId extensionId) throws ResolveException; | |
103 | } |