Interface InstalledExtensionRepository

All Superinterfaces:
AdvancedSearchable, ExtensionRepository, Searchable

@Role public interface InstalledExtensionRepository extends ExtensionRepository, AdvancedSearchable
A repository containing installed extension.

It's generally a virtual repository since the actual extension are generally stored in the local repository.

Since:
4.0M2
Version:
$Id: cbfff129ec27ed3999a48516b42848fb1237b350 $
  • Method Details

    • countExtensions

      int countExtensions()
      Returns:
      the number of local extensions
    • getInstalledExtension

      InstalledExtension getInstalledExtension(String feature, String namespace)
      Return the installed extension associated to the provided feature for the provided namespace (or root namespace since namespaces inherit from root).
      Parameters:
      feature - the extension id or provided feature (virtual extension)
      namespace - the namespace where the extension is installed, null mean installed in all namespaces (root namespace)
      Returns:
      the extension, null if none could be found
    • getInstalledExtensions

      Collection<InstalledExtension> getInstalledExtensions()
      Returns:
      all installed local extensions, an empty collection if none could be found
    • getInstalledExtensions

      Collection<InstalledExtension> getInstalledExtensions(String namespace)
      Return all the extensions available for the provided namespace. This also include root extension since namespaces inherit from root.

      Note that getInstalledExtensions() return all the extensions installed in all namespaces while getInstalledExtensions(String) with null return only those that are globally available.

      Parameters:
      namespace - the namespace where to search for installed extensions, null mean installed in all namespaces (root namespace)
      Returns:
      all the local extensions installed in the provided namespace, an empty collection if none could be found
    • installExtension

      InstalledExtension installExtension(LocalExtension extension, String namespace, boolean dependency) throws InstallException
      Indicate that the provided extension is installed in the provided namespace.
      Parameters:
      extension - the extension to install
      namespace - the namespace in which the extension is installed
      dependency - indicate if the extension is stored as a dependency of another one
      Returns:
      the new InstalledExtension
      Throws:
      InstallException - error when trying to install provided extension
    • installExtension

      InstalledExtension installExtension(LocalExtension extension, String namespace, boolean dependency, Map<String,Object> properties) throws InstallException
      Indicate that the provided extension is installed in the specified namespace with the given properties.
      Parameters:
      extension - the extension to install
      namespace - the namespace in which the extension is installed
      dependency - indicate if the installed extension is stored as a dependency of another extension
      properties - the custom properties to set on the installed extension for the specified namespace
      Returns:
      the new InstalledExtension
      Throws:
      InstallException - error when trying to install provided extension
      Since:
      7.0M2
    • getInstalledExtension

      InstalledExtension getInstalledExtension(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
    • uninstallExtension

      void uninstallExtension(InstalledExtension extension, String namespace) throws UninstallException
      Indicate that the provided extension is uninstalled from provided namespace.

      Extension is never removed form the local repository. It's just namespace related informations.

      Parameters:
      extension - the extension to uninstall
      namespace - the namespace from which the extension is uninstalled
      Throws:
      UninstallException - error when trying to uninstall provided extension
    • getBackwardDependencies

      Collection<InstalledExtension> getBackwardDependencies(String feature, String namespace) throws ResolveException
      Get provided installed extension direct backward dependencies in the provided namespace.

      Only look at the backward dependencies in the provided namespace. To get all the dependencies of a root extension (namespace=null) across namespaces use getBackwardDependencies(ExtensionId) instead.

      This does not follow optional dependencies.

      Parameters:
      feature - the extension unique identifier
      namespace - the namespace where to search for backward dependencies
      Returns:
      the backward dependencies, an empty collection of none could be found
      Throws:
      ResolveException - error when searching for backward dependencies
    • getBackwardDependencies

      default Collection<InstalledExtension> getBackwardDependencies(String feature, String namespace, boolean withOptionals) throws ResolveException
      Get provided installed extension direct backward dependencies in the provided namespace.

      Only look at the backward dependencies in the provided namespace. To get all the dependencies of a root extension (namespace=null) across namespaces use getBackwardDependencies(ExtensionId) instead.

      Parameters:
      feature - the extension unique identifier
      withOptionals - include optional dependencies in the search
      namespace - the namespace where to search for backward dependencies
      Returns:
      the backward dependencies, an empty collection of none could be found
      Throws:
      ResolveException - error when searching for backward dependencies
      Since:
      11.10
    • getBackwardDependencies

      Map<String,Collection<InstalledExtension>> getBackwardDependencies(ExtensionId extensionId) throws ResolveException
      Get all direct backward dependencies by namespace for the provided installed extension.

      This does not follow optional dependencies.

      Parameters:
      extensionId - the extension identifier
      Returns:
      the extension backward dependencies in all namespaces
      Throws:
      ResolveException - error when searching for extension backward dependencies
    • getBackwardDependencies

      default Map<String,Collection<InstalledExtension>> getBackwardDependencies(ExtensionId extensionId, boolean withOptionals) throws ResolveException
      Get all direct backward dependencies by namespace for the provided installed extension.
      Parameters:
      extensionId - the extension identifier
      withOptionals - include optional dependencies in the search
      Returns:
      the extension backward dependencies in all namespaces
      Throws:
      ResolveException - error when searching for extension backward dependencies
      Since:
      11.10
    • getOrphanedDependencies

      default ExtensionNode<InstalledExtension> getOrphanedDependencies(InstalledExtension extension, Namespace namespace)
      Create a dependency tree containing the dependencies which are not shared with other extensions.
      Parameters:
      extension - the extension for which to resolve the exclusive dependencies
      namespace - the namespace where to search for orphan extension dependencies
      Returns:
      the extensions installed as dependency in the passed namespace and which no longer have backward dependencies if the extension is uninstalled
      Since:
      11.10
    • resolve

      InstalledExtension 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.
      Specified by:
      resolve in interface ExtensionRepository
      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
    • resolve

      InstalledExtension 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.
      Specified by:
      resolve in interface ExtensionRepository
      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
    • searchInstalledExtensions

      IterableResult<InstalledExtension> searchInstalledExtensions(String pattern, String namespace, int offset, int nb) throws SearchException
      Search installed extensions based of the provided pattern and only in the passed namespace.

      The pattern is a simple character chain.

      Parameters:
      pattern - the pattern to search
      namespace - the namespace where to search
      offset - the offset from where to start returning search results
      nb - the maximum number of search results to return
      Returns:
      the found extensions descriptors, empty list if nothing could be found
      Throws:
      SearchException - error when trying to search provided pattern
      Since:
      5.3M1
    • searchInstalledExtensions

      IterableResult<InstalledExtension> searchInstalledExtensions(String namespace, ExtensionQuery query) throws SearchException
      Search installed extensions based of the provided query and only in the passed namespace.
      Parameters:
      namespace - the namespace where to search
      query - the extension query used to filter and order the result
      Returns:
      the found extensions descriptors, empty list if nothing could be found
      Throws:
      SearchException - error when trying to search provided pattern
      Since:
      7.0M2
    • searchInstalledExtensions

      default IterableResult<InstalledExtension> searchInstalledExtensions(ExtensionQuery query) throws SearchException
      Search installed extensions based of the provided query.
      Parameters:
      query - the extension query used to filter and order the result
      Returns:
      the found extensions descriptors, empty list if nothing could be found
      Throws:
      SearchException - error when trying to search provided pattern
      Since:
      8.1RC1
    • searchInstalledExtensions

      default IterableResult<InstalledExtension> searchInstalledExtensions(Collection<String> namespaces, ExtensionQuery query) throws SearchException
      Search installed extensions based of the provided query and only in the passed namespaces.
      Parameters:
      namespaces - the namespaces where to search
      query - the extension query used to filter and order the result
      Returns:
      the found extensions descriptors, empty list if nothing could be found
      Throws:
      SearchException - error when trying to search provided pattern
      Since:
      8.1RC1