Class 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 Details

    • AbstractFilteredExtensionRepository

      public AbstractFilteredExtensionRepository()
  • Method Details

    • addFilter

      public void addFilter(String field, Object value, ExtensionQuery.COMPARISON comparison)
      Parameters:
      field - the name of the field
      value - the value to compare to
      comparison - 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 a ResolveException is thrown.
      Parameters:
      extensionId - the extension identifier
      Returns:
      the found extension descriptor
      Throws:
      ExtensionNotFoundException - when the extension does not exist in the repository
      ResolveException - 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 a ResolveException 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 repository
      ResolveException - 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 versions
      offset - the offset from where to start returning versions
      nb - 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 repository
      ResolveException - 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