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 an
ExtensionRepository
.- Since:
- 4.0M1
- Version:
- $Id: 9019a43af457f952291ec0c0fa2f499978db53a7 $
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
exists
(ExtensionId extensionId) getId()
resolve
(ExtensionDependency extensionDependency) Return extension descriptor from the repository.resolve
(ExtensionId extensionId) Return extension descriptor from the repository.resolveVersions
(String id, int offset, int nb) Return ordered (ascendent) versions for the provided extension id.Methods inherited from class org.xwiki.script.wrap.AbstractWrappingObject
equals, getWrapped, hashCode, resolveWrapped, toString
-
Constructor Details
-
WrappingExtensionRepository
- Parameters:
repository
- the wrapped repository
-
-
Method Details
-
getDescriptor
- Specified by:
getDescriptor
in interfaceExtensionRepository
- Returns:
- the repository descriptor
-
getId
- Specified by:
getId
in interfaceExtensionRepository
- Returns:
- the repository identifier.
-
resolve
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
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
- 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
-