Package org.xwiki.extension.repository
Interface ExtensionRepositoryManager
- All Superinterfaces:
AdvancedSearchable
,ExtensionRepository
,Searchable
Proxy repository in to make easier to search in all remote extension repositories.
- Since:
- 4.0M1
- Version:
- $Id: 688c3543736faebcb3b6e1384cddc44ee62f9bfd $
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
The default priority for extension repository ordering. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRepository
(ExtensionRepository repository) addRepository
(ExtensionRepositoryDescriptor repositoryDescriptor) Create and add a new repository.default ExtensionRepository
addRepository
(ExtensionRepositoryDescriptor repositoryDescriptor, int priority) Create and add a new repository.addRepository
(ExtensionRepositoryId repositoryId) Deprecated.default void
addRepository
(ExtensionRepository repository, int priority) getRepository
(String repositoryId) void
removeRepository
(String repositoryId) Remove a repository form the list.resolve
(ExtensionDependency extensionDependency) Get extension descriptor found in one of the repositories.resolve
(ExtensionId extensionId) Get extension descriptor found in one of the repositories.resolveVersions
(String id, int offset, int nb) Return ordered (ascendent) versions for the provided extension id.Search among all repositories implementingSearchable
interface.search
(ExtensionQuery query) Search among all repositories implementingAdvancedSearchable
interface.Methods inherited from interface org.xwiki.extension.repository.search.AdvancedSearchable
isFilterable, isSortable
Methods inherited from interface org.xwiki.extension.repository.ExtensionRepository
exists, getDescriptor, getId
-
Field Details
-
DEFAULT_PRIORITY
static final int DEFAULT_PRIORITYThe default priority for extension repository ordering.- Since:
- 8.3M1
- See Also:
-
-
Method Details
-
addRepository
@Deprecated ExtensionRepository addRepository(ExtensionRepositoryId repositoryId) throws ExtensionRepositoryException Deprecated.since 4.3M1 useaddRepository(ExtensionRepositoryDescriptor)
insteadCreate and add a new repository.- Parameters:
repositoryId
- the repository identifier- Returns:
- the newly created repository
- Throws:
ExtensionRepositoryException
- failed to createExtensionRepository
for provided identifier
-
addRepository
ExtensionRepository addRepository(ExtensionRepositoryDescriptor repositoryDescriptor) throws ExtensionRepositoryException Create and add a new repository.- Parameters:
repositoryDescriptor
- the repository descriptor- Returns:
- the newly created repository
- Throws:
ExtensionRepositoryException
- failed to createExtensionRepository
for provided identifier- Since:
- 4.3M1
-
addRepository
default ExtensionRepository addRepository(ExtensionRepositoryDescriptor repositoryDescriptor, int priority) throws ExtensionRepositoryException Create and add a new repository.- Parameters:
priority
- the priority in the list of repositoriesrepositoryDescriptor
- the repository descriptor- Returns:
- the newly created repository
- Throws:
ExtensionRepositoryException
- failed to createExtensionRepository
for provided identifier- Since:
- 8.3M1
-
addRepository
- Parameters:
repository
- add an existing repository
-
addRepository
- Parameters:
priority
- the priority in the list of repositoriesrepository
- add an existing repository- Since:
- 8.3M1
-
removeRepository
Remove a repository form the list.- Parameters:
repositoryId
- the repository unique identifier- See Also:
-
getRepository
- Parameters:
repositoryId
- the repository unique identifier- Returns:
- the repository, null if none could be found
- See Also:
-
getRepositories
Collection<ExtensionRepository> getRepositories()- Returns:
- the repositories
-
resolve
Get extension descriptor found in one of the repositories.The proxy search in all repositories and return the first extension it could find.
- Specified by:
resolve
in interfaceExtensionRepository
- Parameters:
extensionId
- the extension identifier- Returns:
- the found extension descriptor
- Throws:
ExtensionNotFoundException
- when the extension does not exist in any of the repositoriesResolveException
- failed to find extension in the repository
-
resolve
Get extension descriptor found in one of the repositories.The proxy search in all repositories and return the first extension it could find.
This method takes
ExtensionDependency
instead ofExtensionId
to allow any implementation ofExtensionRepository
to extension dependencies with filter not supported yet by Extension Manage. As an example Aether implementation add support from classifiers, excludes and version ranges.- Specified by:
resolve
in interfaceExtensionRepository
- Parameters:
extensionDependency
- the extension dependency- Returns:
- the found extension descriptor
- Throws:
ExtensionNotFoundException
- when the dependency does not match any extension in any of the repositoriesResolveException
- failed to find extension in the repository
-
resolveVersions
Return ordered (ascendent) versions for the provided extension id.- Specified by:
resolveVersions
in interfaceExtensionRepository
- Parameters:
id
- the id of the extensions for which to return versionsoffset
- the offset from where to start returning versionsnb
- the maximum number of versions to return- Returns:
- the versions of the provided extension id
- Throws:
ExtensionNotFoundException
- when the extension does not exist in any of the repositoriesResolveException
- fail to find extension for provided id
-
search
Search among all repositories implementingSearchable
interface.- Specified by:
search
in interfaceSearchable
- Parameters:
pattern
- the pattern to searchoffset
- the offset from where to start returning search results, 0-basednb
- the maximum number of search results to return. -1 indicate no limit. 0 indicate that no result will be returned but it can be used to get the total hits.- Returns:
- the found extensions descriptors, empty list if nothing could be found
- Throws:
SearchException
- error when trying to search provided pattern- See Also:
-
search
Search among all repositories implementingAdvancedSearchable
interface.- Specified by:
search
in interfaceAdvancedSearchable
- Parameters:
query
- the query- Returns:
- the found extensions descriptors, empty list if nothing could be found
- Throws:
SearchException
- error when trying to search provided query- Since:
- 7.1M1
- See Also:
-
addRepository(ExtensionRepositoryDescriptor)
instead