Package org.xwiki.extension.repository
Interface LocalExtensionRepository
-
- All Superinterfaces:
AdvancedSearchable
,ExtensionRepository
,Searchable
@Role public interface LocalExtensionRepository extends ExtensionRepository, AdvancedSearchable
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
countExtensions()
LocalExtension
getLocalExtension(ExtensionId extensionId)
Return extension descriptor from the repository.Collection<LocalExtension>
getLocalExtensions()
Collection<LocalExtension>
getLocalExtensionVersions(String id)
void
removeExtension(LocalExtension extension)
Remove extension from local repository.LocalExtension
resolve(ExtensionDependency extensionDependency)
Return extension descriptor from the repository.LocalExtension
resolve(ExtensionId extensionId)
Return extension descriptor from the repository.void
setProperties(LocalExtension localExtension, Map<String,Object> properties)
LocalExtension
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 Detail
-
countExtensions
int countExtensions()
- Returns:
- the number of local extensions
-
getLocalExtension
LocalExtension getLocalExtension(ExtensionId extensionId)
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
Collection<LocalExtension> getLocalExtensionVersions(String id)
- 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
LocalExtension storeExtension(Extension extension) throws LocalExtensionRepositoryException
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
void removeExtension(LocalExtension extension) throws ResolveException
Remove extension from local repository.- Parameters:
extension
- the extension to remove- Throws:
ResolveException
- error when trying to find provided extension
-
resolve
LocalExtension resolve(ExtensionDependency extensionDependency) throws ResolveException
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
LocalExtension resolve(ExtensionId extensionId) throws ResolveException
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
-
-