org.xwiki.extension.repository
Interface InstalledExtensionRepository

All Superinterfaces:
ExtensionRepository, Searchable

@Role
public interface InstalledExtensionRepository
extends ExtensionRepository, Searchable

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$

Method Summary
 int countExtensions()
           
 Map<String,Collection<InstalledExtension>> getBackwardDependencies(ExtensionId extensionId)
          Get all backward dependencies by namespace for the provided installed extension.
 Collection<InstalledExtension> getBackwardDependencies(String feature, String namespace)
          Get provided installed extension backward dependencies in the provided namespace.
 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).
 Collection<InstalledExtension> getInstalledExtensions()
           
 Collection<InstalledExtension> getInstalledExtensions(String namespace)
          Return all the extensions available for the provided namespace.
 InstalledExtension installExtension(LocalExtension extension, String namespace, boolean dependency)
          Indicate that the provided extension is installed in the provided namespace.
 InstalledExtension resolve(ExtensionDependency extensionDependency)
          Return extension descriptor from the repository.
 InstalledExtension resolve(ExtensionId extensionId)
          Return extension descriptor from the repository.
 void uninstallExtension(InstalledExtension extension, String namespace)
          Indicate that the provided extension is uninstalled from provided namespace.
 
Methods inherited from interface org.xwiki.extension.repository.ExtensionRepository
exists, getId, resolveVersions
 
Methods inherited from interface org.xwiki.extension.repository.search.Searchable
search
 

Method Detail

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

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

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

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

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:
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:
ResolveException - failed to find extension in the repository


Copyright © 2004-2012 XWiki. All Rights Reserved.