Package org.xwiki.extension.repository
Interface ExtensionRepositoryManager
-
- All Superinterfaces:
AdvancedSearchable
,ExtensionRepository
,Searchable
@Role public interface ExtensionRepositoryManager extends ExtensionRepository, AdvancedSearchable
Proxy repository in to make easier to search in all remote extension repositories.- Since:
- 4.0M1
- Version:
- $Id: 688c3543736faebcb3b6e1384cddc44ee62f9bfd $
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_PRIORITY
The default priority for extension repository ordering.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description void
addRepository(ExtensionRepository repository)
ExtensionRepository
addRepository(ExtensionRepositoryDescriptor repositoryDescriptor)
Create and add a new repository.default ExtensionRepository
addRepository(ExtensionRepositoryDescriptor repositoryDescriptor, int priority)
Create and add a new repository.ExtensionRepository
addRepository(ExtensionRepositoryId repositoryId)
Deprecated.since 4.3M1 useaddRepository(ExtensionRepositoryDescriptor)
insteaddefault void
addRepository(ExtensionRepository repository, int priority)
Collection<ExtensionRepository>
getRepositories()
ExtensionRepository
getRepository(String repositoryId)
void
removeRepository(String repositoryId)
Remove a repository form the list.Extension
resolve(ExtensionDependency extensionDependency)
Get extension descriptor found in one of the repositories.Extension
resolve(ExtensionId extensionId)
Get extension descriptor found in one of the repositories.IterableResult<Version>
resolveVersions(String id, int offset, int nb)
Return ordered (ascendent) versions for the provided extension id.IterableResult<Extension>
search(String pattern, int offset, int nb)
Search among all repositories implementingSearchable
interface.IterableResult<Extension>
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 Detail
-
DEFAULT_PRIORITY
static final int DEFAULT_PRIORITY
The default priority for extension repository ordering.- Since:
- 8.3M1
- See Also:
- Constant Field Values
-
-
Method Detail
-
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
void addRepository(ExtensionRepository repository)
- Parameters:
repository
- add an existing repository
-
addRepository
default void addRepository(ExtensionRepository repository, int priority)
- Parameters:
priority
- the priority in the list of repositoriesrepository
- add an existing repository- Since:
- 8.3M1
-
removeRepository
void removeRepository(String repositoryId)
Remove a repository form the list.- Parameters:
repositoryId
- the repository unique identifier- See Also:
ExtensionRepository.getId()
-
getRepository
ExtensionRepository getRepository(String repositoryId)
- Parameters:
repositoryId
- the repository unique identifier- Returns:
- the repository, null if none could be found
- See Also:
ExtensionRepository.getId()
-
getRepositories
Collection<ExtensionRepository> getRepositories()
- Returns:
- the repositories
-
resolve
Extension resolve(ExtensionId extensionId) throws ResolveException
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
Extension resolve(ExtensionDependency extensionDependency) throws ResolveException
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
IterableResult<Version> resolveVersions(String id, int offset, int nb) throws ResolveException
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
IterableResult<Extension> search(String pattern, int offset, int nb) throws SearchException
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:
Searchable
-
search
IterableResult<Extension> search(ExtensionQuery query) throws SearchException
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:
AdvancedSearchable
-
-