Package org.xwiki.extension.wrap
Class WrappingExtensionRepository<T extends ExtensionRepository>
- java.lang.Object
-
- org.xwiki.script.wrap.AbstractWrappingObject<T>
-
- org.xwiki.extension.wrap.AbstractWrappingObject<T>
-
- org.xwiki.extension.wrap.WrappingExtensionRepository<T>
-
- Type Parameters:
T- the type of the wrapped object
- All Implemented Interfaces:
ExtensionRepository
public class WrappingExtensionRepository<T extends ExtensionRepository> extends AbstractWrappingObject<T> implements ExtensionRepository
Wrap anExtensionRepository.- Since:
- 4.0M1
- Version:
- $Id: 9019a43af457f952291ec0c0fa2f499978db53a7 $
-
-
Constructor Summary
Constructors Constructor Description WrappingExtensionRepository(T repository)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists(ExtensionId extensionId)ExtensionRepositoryDescriptorgetDescriptor()ExtensionRepositoryIdgetId()Extensionresolve(ExtensionDependency extensionDependency)Return extension descriptor from the repository.Extensionresolve(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.
-
-
-
Constructor Detail
-
WrappingExtensionRepository
public WrappingExtensionRepository(T repository)
- Parameters:
repository- the wrapped repository
-
-
Method Detail
-
getDescriptor
public ExtensionRepositoryDescriptor getDescriptor()
- Specified by:
getDescriptorin interfaceExtensionRepository- Returns:
- the repository descriptor
-
getId
public ExtensionRepositoryId getId()
- Specified by:
getIdin interfaceExtensionRepository- Returns:
- the repository identifier.
-
resolve
public Extension resolve(ExtensionId extensionId) throws ResolveException
Description copied from interface:ExtensionRepositoryReturn extension descriptor from the repository. If the extension can't be found aResolveExceptionis thrown.- Specified by:
resolvein interfaceExtensionRepository- Parameters:
extensionId- the extension identifier- Returns:
- the found extension descriptor
- Throws:
ExtensionNotFoundException- when the extension does not exist in the repositoryResolveException- failed to find extension in the repository
-
resolve
public Extension resolve(ExtensionDependency extensionDependency) throws ResolveException
Description copied from interface:ExtensionRepositoryReturn extension descriptor from the repository. If the extension can't be found aResolveExceptionis thrown.- Specified by:
resolvein interfaceExtensionRepository- 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 repositoryResolveException- failed to find extension in the repository
-
exists
public boolean exists(ExtensionId extensionId)
- Specified by:
existsin interfaceExtensionRepository- 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:ExtensionRepositoryReturn ordered (ascendent) versions for the provided extension id.- Specified by:
resolveVersionsin interfaceExtensionRepository- Parameters:
id- the id of the extensions for which to return versionsoffset- the offset from where to start returning versionsnb- the maximum number of versions to return- Returns:
- the versions of the provided extension id
- Throws:
ExtensionNotFoundException- when the extension does not exist in the repositoryResolveException- fail to find extension for provided id
-
-