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 boolean
exists(ExtensionId extensionId)
ExtensionRepositoryDescriptor
getDescriptor()
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.
-
-
-
Constructor Detail
-
WrappingExtensionRepository
public WrappingExtensionRepository(T repository)
- Parameters:
repository
- the wrapped repository
-
-
Method Detail
-
getDescriptor
public ExtensionRepositoryDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceExtensionRepository
- Returns:
- the repository descriptor
-
getId
public ExtensionRepositoryId getId()
- Specified by:
getId
in interfaceExtensionRepository
- 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 aResolveException
is thrown.- Specified by:
resolve
in 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:ExtensionRepository
Return extension descriptor from the repository. If the extension can't be found aResolveException
is thrown.- Specified by:
resolve
in 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:
exists
in 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:ExtensionRepository
Return ordered (ascendent) versions for the provided extension id.- Specified by:
resolveVersions
in 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
-
-