org.xwiki.extension.wrap
Class WrappingExtensionRepository<T extends ExtensionRepository>

java.lang.Object
  extended by org.xwiki.extension.wrap.AbstractWrappingObject<T>
      extended by org.xwiki.extension.wrap.WrappingExtensionRepository<T>
Type Parameters:
T -
All Implemented Interfaces:
ExtensionRepository

public class WrappingExtensionRepository<T extends ExtensionRepository>
extends AbstractWrappingObject<T>
implements ExtensionRepository

Wrap an ExtensionRepository.

Since:
4.0M1
Version:
$Id$

Constructor Summary
WrappingExtensionRepository(T repository)
           
 
Method Summary
 boolean exists(ExtensionId extensionId)
           
 ExtensionRepositoryId getId()
           
 Extension resolve(ExtensionDependency extensionDependency)
          Return extension descriptor from the repository.
 Extension resolve(ExtensionId extensionId)
          Return extension descriptor from the repository.
 IterableResult<Version> resolveVersions(String id, int offset, int nb)
          Return ordered (ascendent) versions for the provided extension id.
 
Methods inherited from class org.xwiki.extension.wrap.AbstractWrappingObject
equals, getWrapped, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WrappingExtensionRepository

public WrappingExtensionRepository(T repository)
Parameters:
repository - the wrapped repository
Method Detail

getId

public ExtensionRepositoryId getId()
Specified by:
getId in interface ExtensionRepository
Returns:
the repository identifier.

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.

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

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.

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

exists

public boolean exists(ExtensionId extensionId)
Specified by:
exists in interface ExtensionRepository
Parameters:
extensionId - the extension identifier
Returns:
true if the extension exists 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.

Specified by:
resolveVersions in interface ExtensionRepository
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


Copyright © 2004-2012 XWiki. All Rights Reserved.