org.xwiki.extension.repository
Interface LocalExtensionRepository

All Superinterfaces:
ExtensionRepository, Searchable

@Role
public interface LocalExtensionRepository
extends ExtensionRepository, Searchable

A repository containing local extension.

That's were remote extension are stored after being downloaded and from where extension are actually installed by their respective handlers.

Since:
4.0M1
Version:
$Id$

Method Summary
 int countExtensions()
           
 Collection<LocalExtension> getLocalExtensions()
           
 Collection<LocalExtension> getLocalExtensionVersions(String id)
           
 void removeExtension(LocalExtension extension)
          Remove extension from local repository.
 LocalExtension resolve(ExtensionDependency extensionDependency)
          Return extension descriptor from the repository.
 LocalExtension resolve(ExtensionId extensionId)
          Return extension descriptor from the repository.
 void setProperties(LocalExtension localExtension, Map<String,Object> properties)
           
 LocalExtension storeExtension(Extension extension)
          Store provided extension (generally a remote extension) in the local repository.
 
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

getLocalExtensions

Collection<LocalExtension> getLocalExtensions()
Returns:
all the local extensions, an empty collection if none could be found

getLocalExtensionVersions

Collection<LocalExtension> getLocalExtensionVersions(String id)
Parameters:
id - the id of the extension
Returns:
the version of the extension stored in the local repository order from the upper version to the lower version

storeExtension

LocalExtension storeExtension(Extension extension)
                              throws LocalExtensionRepositoryException
Store provided extension (generally a remote extension) in the local repository.

Parameters:
extension - the extension to store
Returns:
the new local extension
Throws:
LocalExtensionRepositoryException - error when trying store provided extension in the local repository

setProperties

void setProperties(LocalExtension localExtension,
                   Map<String,Object> properties)
                   throws LocalExtensionRepositoryException
Parameters:
localExtension - the local extension to modify
properties - the properties to set
Throws:
LocalExtensionRepositoryException - error when trying to save the extension change

removeExtension

void removeExtension(LocalExtension extension)
                     throws ResolveException
Remove extension from local repository.

Parameters:
extension - the extension to remove
Throws:
ResolveException - error when trying to find provided extension

resolve

LocalExtension 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

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