org.xwiki.extension.repository
Interface ExtensionRepositoryManager


@Role
public interface ExtensionRepositoryManager

Proxy behind remote repositories.

Since:
4.0M1
Version:
$Id: c4a987b28345f6c3eca596fe7c2ef3b538f322d5 $

Method Summary
 void addRepository(ExtensionRepository repository)
           
 ExtensionRepository addRepository(ExtensionRepositoryDescriptor repositoryDescriptor)
          Create and add a new repository.
 ExtensionRepository addRepository(ExtensionRepositoryId repositoryId)
          Deprecated. since 4.3M1 use addRepository(ExtensionRepositoryDescriptor) instead
 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 repository implementing Searchable interface.
 

Method Detail

addRepository

@Deprecated
ExtensionRepository addRepository(ExtensionRepositoryId repositoryId)
                                  throws ExtensionRepositoryException
Deprecated. since 4.3M1 use addRepository(ExtensionRepositoryDescriptor) instead

Create and add a new repository.

Parameters:
repositoryId - the repository identifier
Returns:
the newly created repository
Throws:
ExtensionRepositoryException - failed to create ExtensionRepository 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 create ExtensionRepository for provided identifier
Since:
4.3M1

addRepository

void addRepository(ExtensionRepository repository)
Parameters:
repository - add an existing repository

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.

Parameters:
extensionId - the extension identifier
Returns:
the found extension descriptor
Throws:
ResolveException - 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 of ExtensionId to allow any implementation of ExtensionRepository to extension dependencies with filter not supported yet by Extension Manage. As an example Aether implementation add support from classifiers, excludes and version ranges.

Parameters:
extensionDependency - the extension dependency
Returns:
the found extension descriptor
Throws:
ResolveException - 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.

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:
ResolveException - fail to find extension for provided id

search

IterableResult<Extension> search(String pattern,
                                 int offset,
                                 int nb)
Search among all repository implementing Searchable interface.

Parameters:
pattern - the pattern to search
offset - the offset from where to start returning search results, 0-based
nb - 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
See Also:
Searchable


Copyright © 2004-2013 XWiki. All Rights Reserved.