Interface PackageRegistries.Registries
-
- All Known Implementing Classes:
PackageRegistriesImpl.RegistriesImpl
- Enclosing interface:
- PackageRegistries
public static interface PackageRegistries.Registries
Collects the available registries bound to a resolver. Since the JcrPackageRegistry is instantiated in a resolver context, the set of registries must be an object that also depends on a resolver (on the current request).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<String>
getNamespaces()
org.apache.jackrabbit.vault.packaging.registry.PackageRegistry
getRegistry(String namespaceOrPath)
Gives thePackageRegistry
for a namespace (e.g.Collection<org.apache.jackrabbit.vault.packaging.registry.PackageRegistry>
iterable()
org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage>
open(org.apache.jackrabbit.vault.packaging.PackageId id)
Opens aRegisteredPackage
- remember to close it (AutoCloseable).org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.PackageId>
resolve(String path)
Finds the namespace and package that matches the given path.org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.PackageId>
resolve(String namespace, org.apache.jackrabbit.vault.packaging.PackageId packageId)
Checks whether there is actually package with that id in the registry, looking through the registries if no namespace is given.org.apache.commons.lang3.tuple.Pair<org.apache.jackrabbit.vault.packaging.registry.PackageRegistry,org.apache.jackrabbit.vault.packaging.PackageId>
resolve(org.apache.jackrabbit.vault.packaging.Dependency dependency, boolean onlyInstalled)
Finds the bestPackageId
that matches the dependency filter, if there is one.
-
-
-
Method Detail
-
iterable
@Nonnull Collection<org.apache.jackrabbit.vault.packaging.registry.PackageRegistry> iterable()
-
getNamespaces
@Nonnull Collection<String> getNamespaces()
-
getRegistry
@Nullable org.apache.jackrabbit.vault.packaging.registry.PackageRegistry getRegistry(@Nonnull String namespaceOrPath)
Gives thePackageRegistry
for a namespace (e.g. @fs) or a path starting with a namespace ( e.g. /@fs/some/thing). If the path does not have an explicit namespace (e.g. mixed view) but matches a package / package version in one of the registries, we return that registry; if there are more than one, we return the registry with the highest version, as this one is probably most interesting.
-
resolve
@Nullable org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.PackageId> resolve(@Nullable String path) throws IOException
Finds the namespace and package that matches the given path. If the path doesn't encode the version, we return the package with the highest version. If there is no namespace given (merged mode), we search the registries.- Throws:
IOException
-
resolve
@Nullable org.apache.commons.lang3.tuple.Pair<org.apache.jackrabbit.vault.packaging.registry.PackageRegistry,org.apache.jackrabbit.vault.packaging.PackageId> resolve(@Nonnull org.apache.jackrabbit.vault.packaging.Dependency dependency, boolean onlyInstalled) throws IOException
Finds the bestPackageId
that matches the dependency filter, if there is one.- Throws:
IOException
-
open
@Nullable org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.registry.RegisteredPackage> open(@Nonnull org.apache.jackrabbit.vault.packaging.PackageId id) throws IOException
Opens aRegisteredPackage
- remember to close it (AutoCloseable). As additional information we return the namespace where it was found.- Throws:
IOException
-
resolve
@Nullable org.apache.commons.lang3.tuple.Pair<String,org.apache.jackrabbit.vault.packaging.PackageId> resolve(@Nullable String namespace, @Nullable org.apache.jackrabbit.vault.packaging.PackageId packageId) throws IOException
Checks whether there is actually package with that id in the registry, looking through the registries if no namespace is given. If package wasn't found, this returns null.- Throws:
IOException
-
-