Package org.xwiki.extension.repository
Interface LocalExtensionRepository
- All Superinterfaces:
AdvancedSearchable
,ExtensionRepository
,Searchable
A repository containing local extension.
That's were remote extension are stored after being downloaded and from where extension are actually installed by their respective handlers.
- Since:
- 4.0M1
- Version:
- $Id: cf6259b5a2dd7681a9bbde7605f8de5e119dae81 $
-
Method Summary
Modifier and TypeMethodDescriptionint
getLocalExtension
(ExtensionId extensionId) Return extension descriptor from the repository.void
removeExtension
(LocalExtension extension) Remove extension from local repository.resolve
(ExtensionDependency extensionDependency) Return extension descriptor from the repository.resolve
(ExtensionId extensionId) Return extension descriptor from the repository.void
setProperties
(LocalExtension localExtension, Map<String, Object> properties) storeExtension
(Extension extension) Store provided extension (generally a remote extension) in the local repository.Methods inherited from interface org.xwiki.extension.repository.search.AdvancedSearchable
isFilterable, isSortable, search
Methods inherited from interface org.xwiki.extension.repository.ExtensionRepository
exists, getDescriptor, getId, resolveVersions
Methods inherited from interface org.xwiki.extension.repository.search.Searchable
search
-
Method Details
-
countExtensions
int countExtensions()- Returns:
- the number of local extensions
-
getLocalExtension
Return extension descriptor from the repository. If the extension can't be found null is returned.- Parameters:
extensionId
- the extension identifier- Returns:
- the found extension descriptor or null if none could be found
- Since:
- 4.2RC1
-
getLocalExtensions
Collection<LocalExtension> getLocalExtensions()- Returns:
- all the local extensions, an empty collection if none could be found
-
getLocalExtensionVersions
- Parameters:
id
- the id of the extension- Returns:
- the version of the extension stored in the local repository order from the upper version to the lower version
-
storeExtension
Store provided extension (generally a remote extension) in the local repository.- Parameters:
extension
- the extension to store- Returns:
- the new local extension
- Throws:
LocalExtensionRepositoryException
- error when trying store provided extension in the local repository
-
setProperties
void setProperties(LocalExtension localExtension, Map<String, Object> properties) throws LocalExtensionRepositoryException- Parameters:
localExtension
- the local extension to modifyproperties
- the properties to set- Throws:
LocalExtensionRepositoryException
- error when trying to save the extension change
-
removeExtension
Remove extension from local repository.- Parameters:
extension
- the extension to remove- Throws:
ResolveException
- error when trying to find provided extension
-
resolve
Description copied from interface:ExtensionRepository
Return extension descriptor from the repository. If the extension can't be found aResolveException
is thrown.- Specified by:
resolve
in interfaceExtensionRepository
- Parameters:
extensionDependency
- the target extension as a dependency- Returns:
- the found extension descriptor
- Throws:
ExtensionNotFoundException
- when the dependency does not match any extension in the repositoryResolveException
- failed to find extension in the repository
-
resolve
Description copied from interface:ExtensionRepository
Return extension descriptor from the repository. If the extension can't be found aResolveException
is thrown.- Specified by:
resolve
in interfaceExtensionRepository
- Parameters:
extensionId
- the extension identifier- Returns:
- the found extension descriptor
- Throws:
ExtensionNotFoundException
- when the extension does not exist in the repositoryResolveException
- failed to find extension in the repository
-