@Role public interface InstalledExtensionRepository extends ExtensionRepository, AdvancedSearchable
It's generally a virtual repository since the actual extension are generally stored in the local repository.
Modifier and Type | Method and Description |
---|---|
int |
countExtensions() |
Map<String,Collection<InstalledExtension>> |
getBackwardDependencies(ExtensionId extensionId)
Get all backward dependencies by namespace for the provided installed extension.
|
default Map<String,Collection<InstalledExtension>> |
getBackwardDependencies(ExtensionId extensionId,
boolean withOptionals)
Get all backward dependencies by namespace for the provided installed extension.
|
Collection<InstalledExtension> |
getBackwardDependencies(String feature,
String namespace)
Get provided installed extension backward dependencies in the provided namespace.
|
default Collection<InstalledExtension> |
getBackwardDependencies(String feature,
String namespace,
boolean withOptionals)
Get provided installed extension backward dependencies in the provided namespace.
|
InstalledExtension |
getInstalledExtension(ExtensionId extensionId)
Return extension descriptor from the repository.
|
InstalledExtension |
getInstalledExtension(String feature,
String namespace)
Return the installed extension associated to the provided feature for the provided namespace (or root namespace
since namespaces inherit from root).
|
Collection<InstalledExtension> |
getInstalledExtensions() |
Collection<InstalledExtension> |
getInstalledExtensions(String namespace)
Return all the extensions available for the provided namespace.
|
default ExtensionNode<InstalledExtension> |
getOrphanedDependencies(InstalledExtension extension,
Namespace namespace)
Create a dependency tree containing the dependencies which are not shared with other extensions.
|
InstalledExtension |
installExtension(LocalExtension extension,
String namespace,
boolean dependency)
Indicate that the provided extension is installed in the provided namespace.
|
InstalledExtension |
installExtension(LocalExtension extension,
String namespace,
boolean dependency,
Map<String,Object> properties)
Indicate that the provided extension is installed in the specified namespace with the given properties.
|
InstalledExtension |
resolve(ExtensionDependency extensionDependency)
Return extension descriptor from the repository.
|
InstalledExtension |
resolve(ExtensionId extensionId)
Return extension descriptor from the repository.
|
default IterableResult<InstalledExtension> |
searchInstalledExtensions(Collection<String> namespaces,
ExtensionQuery query)
Search installed extensions based of the provided query and only in the passed namespaces.
|
default IterableResult<InstalledExtension> |
searchInstalledExtensions(ExtensionQuery query)
Search installed extensions based of the provided query.
|
IterableResult<InstalledExtension> |
searchInstalledExtensions(String namespace,
ExtensionQuery query)
Search installed extensions based of the provided query and only in the passed namespace.
|
IterableResult<InstalledExtension> |
searchInstalledExtensions(String pattern,
String namespace,
int offset,
int nb)
Search installed extensions based of the provided pattern and only in the passed namespace.
|
void |
uninstallExtension(InstalledExtension extension,
String namespace)
Indicate that the provided extension is uninstalled from provided namespace.
|
exists, getDescriptor, getId, resolveVersions
isFilterable, isSortable, search
search
int countExtensions()
InstalledExtension getInstalledExtension(String feature, String namespace)
feature
- the extension id or provided feature (virtual extension)namespace
- the namespace where the extension is installed, null mean installed in all namespaces (root
namespace)Collection<InstalledExtension> getInstalledExtensions()
Collection<InstalledExtension> getInstalledExtensions(String namespace)
Note that getInstalledExtensions()
return all the extensions installed in all namespaces while
getInstalledExtensions(String)
with null
return only those that are globally available.
namespace
- the namespace where to search for installed extensions, null mean installed in all namespaces
(root namespace)InstalledExtension installExtension(LocalExtension extension, String namespace, boolean dependency) throws InstallException
extension
- the extension to installnamespace
- the namespace in which the extension is installeddependency
- indicate if the extension is stored as a dependency of another oneInstalledExtension
InstallException
- error when trying to install provided extensionInstalledExtension installExtension(LocalExtension extension, String namespace, boolean dependency, Map<String,Object> properties) throws InstallException
extension
- the extension to installnamespace
- the namespace in which the extension is installeddependency
- indicate if the installed extension is stored as a dependency of another extensionproperties
- the custom properties to set on the installed extension for the specified namespaceInstalledExtension
InstallException
- error when trying to install provided extensionInstalledExtension getInstalledExtension(ExtensionId extensionId)
null
is returned.extensionId
- the extension identifiervoid uninstallExtension(InstalledExtension extension, String namespace) throws UninstallException
Extension is never removed form the local repository. It's just namespace related informations.
extension
- the extension to uninstallnamespace
- the namespace from which the extension is uninstalledUninstallException
- error when trying to uninstall provided extensionCollection<InstalledExtension> getBackwardDependencies(String feature, String namespace) throws ResolveException
Only look at the backward dependencies in the provided namespace. To get all the dependencies of a root extension
(namespace=null) across namespaces use getBackwardDependencies(ExtensionId)
instead.
This does not follow optional dependencies.
feature
- the extension unique identifiernamespace
- the namespace where to search for backward dependenciesResolveException
- error when searching for backward dependenciesdefault Collection<InstalledExtension> getBackwardDependencies(String feature, String namespace, boolean withOptionals) throws ResolveException
Only look at the backward dependencies in the provided namespace. To get all the dependencies of a root extension
(namespace=null) across namespaces use getBackwardDependencies(ExtensionId)
instead.
feature
- the extension unique identifierwithOptionals
- include optional dependencies in the searchnamespace
- the namespace where to search for backward dependenciesResolveException
- error when searching for backward dependenciesMap<String,Collection<InstalledExtension>> getBackwardDependencies(ExtensionId extensionId) throws ResolveException
This does not follow optional dependencies.
extensionId
- the extension identifierResolveException
- error when searching for extension backward dependenciesdefault Map<String,Collection<InstalledExtension>> getBackwardDependencies(ExtensionId extensionId, boolean withOptionals) throws ResolveException
extensionId
- the extension identifierwithOptionals
- include optional dependencies in the searchResolveException
- error when searching for extension backward dependenciesdefault ExtensionNode<InstalledExtension> getOrphanedDependencies(InstalledExtension extension, Namespace namespace)
extension
- the extension for which to resolve the exclusive dependenciesnamespace
- the namespace where to search for orphan extension dependenciesInstalledExtension resolve(ExtensionDependency extensionDependency) throws ResolveException
ExtensionRepository
ResolveException
is
thrown.resolve
in interface ExtensionRepository
extensionDependency
- the target extension as a dependencyExtensionNotFoundException
- when the dependency does not match any extension in the repositoryResolveException
- failed to find extension in the repositoryInstalledExtension resolve(ExtensionId extensionId) throws ResolveException
ExtensionRepository
ResolveException
is
thrown.resolve
in interface ExtensionRepository
extensionId
- the extension identifierExtensionNotFoundException
- when the extension does not exist in the repositoryResolveException
- failed to find extension in the repositoryIterableResult<InstalledExtension> searchInstalledExtensions(String pattern, String namespace, int offset, int nb) throws SearchException
The pattern is a simple character chain.
pattern
- the pattern to searchnamespace
- the namespace where to searchoffset
- the offset from where to start returning search resultsnb
- the maximum number of search results to returnSearchException
- error when trying to search provided patternIterableResult<InstalledExtension> searchInstalledExtensions(String namespace, ExtensionQuery query) throws SearchException
namespace
- the namespace where to searchquery
- the extension query used to filter and order the resultSearchException
- error when trying to search provided patterndefault IterableResult<InstalledExtension> searchInstalledExtensions(ExtensionQuery query) throws SearchException
query
- the extension query used to filter and order the resultSearchException
- error when trying to search provided patterndefault IterableResult<InstalledExtension> searchInstalledExtensions(Collection<String> namespaces, ExtensionQuery query) throws SearchException
namespaces
- the namespaces where to searchquery
- the extension query used to filter and order the resultSearchException
- error when trying to search provided patternCopyright © 2004–2021 XWiki. All rights reserved.