Package org.xwiki.extension.repository
Class AbstractFilteredExtensionRepository
- java.lang.Object
-
- org.xwiki.extension.repository.AbstractExtensionRepository
-
- org.xwiki.extension.repository.AbstractAdvancedSearchableExtensionRepository
-
- org.xwiki.extension.repository.AbstractFilteredExtensionRepository
-
- All Implemented Interfaces:
ExtensionRepository
,AdvancedSearchable
,Searchable
public abstract class AbstractFilteredExtensionRepository extends AbstractAdvancedSearchableExtensionRepository
A base class to use for a repository proxy searching in all remote extension repositories but filtering the result on provided criteria.- Since:
- 8.3RC1
- Version:
- $Id: a67c8757eb2fff7e82b91cbefdf6fb565f6b862b $
-
-
Constructor Summary
Constructors Constructor Description AbstractFilteredExtensionRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFilter(String field, Object value, ExtensionQuery.COMPARISON comparison)
boolean
isFilterable()
boolean
isSortable()
Extension
resolve(ExtensionDependency extensionDependency)
Return extension descriptor from the repository.Extension
resolve(ExtensionId extensionId)
Return extension descriptor from the repository.IterableResult<Version>
resolveVersions(String id, int offset, int nb)
Return ordered (ascendent) versions for the provided extension id.IterableResult<Extension>
search(ExtensionQuery inputQuery)
Search extension based of the provided query.-
Methods inherited from class org.xwiki.extension.repository.AbstractAdvancedSearchableExtensionRepository
search
-
Methods inherited from class org.xwiki.extension.repository.AbstractExtensionRepository
exists, getDescriptor, getId, setDescriptor, setId
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.xwiki.extension.repository.ExtensionRepository
exists, getDescriptor, getId
-
-
-
-
Method Detail
-
addFilter
public void addFilter(String field, Object value, ExtensionQuery.COMPARISON comparison)
- Parameters:
field
- the name of the fieldvalue
- the value to compare tocomparison
- the comparison to apply
-
resolve
public Extension 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.- 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
-
resolve
public Extension 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.- 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
-
resolveVersions
public IterableResult<Version> resolveVersions(String id, int offset, int nb) throws ResolveException
Description copied from interface:ExtensionRepository
Return ordered (ascendent) versions for the provided extension id.- 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 the repositoryResolveException
- fail to find extension for provided id
-
isFilterable
public boolean isFilterable()
- Returns:
- true if the searched extensions can be filtered
-
isSortable
public boolean isSortable()
- Returns:
- true if the searched extensions can be ordered
-
search
public IterableResult<Extension> search(ExtensionQuery inputQuery) throws SearchException
Description copied from interface:AdvancedSearchable
Search extension based of the provided query.- Parameters:
inputQuery
- the query- Returns:
- the found extensions descriptors, empty list if nothing could be found
- Throws:
SearchException
- error when trying to search provided query
-
-