saker.nest Documentation TaskDoc JavaDoc Packages
public interface BundleStorageView
Interface for providing configured access to a backing bundle storage.

A bundle storage view is a configured view to a backing bundle storage. It can be used to retrieve the actual bundles and informations related to bundles contained in a given storage.

Based on the configuration that was used to instantiate it, a bundle storage view may perform different operations and return different results. E.g. if it uses a server storage, but is configured to be offline, then it won't download bundles from the associated server.

Instances of bundle storage views can be retrieved from NestBundleStorageConfiguration.

Each bundle storage view has a StorageViewKey that uniquely identifies its backing storage and configured behaviour. These keys may be serialized and used to retrieve the storage view again using NestBundleStorageConfiguration.getBundleStorageViewForKey(StorageViewKey). This can useful for implementing incremental builds and other operations.

This interface is not to be implemented by clients.

Methods
public NestRepositoryBundle
Gets the bundle for the given bundle identifier.
public default BundleInformation
Gets the information about a given bundle in the storage view.
public BundleStorage
Gets the backing bundle storage object.
public StorageViewKey
Gets the storage view key of this view.
public Map<extends ExternalArchiveKey, ? extends ExternalArchive>
Loads the external archives from the argument dependency information.
public Map<String, ? extends Set<extends BundleIdentifier>>
Looks up the identifiers of bundles that have the same bundle name as the argument.
public Set<extends BundleIdentifier>
Looks up the identifiers of bundles which are present in this bundle storage view and only differ (or equal) in version number to the argument.
Gets the bundle for the given bundle identifier.

The bundle storage view is asked to locate and load the bundle with the given identifier. It will execute the operation in an implementation dependent manner for the storage view. If the bundle was not found, or cannot be loaded, BundleLoadingFailedException will be thrown.

The storage view may require the bundle identifier to have a version qualifier.

bundleidThe bundle identifier to get the bundle for.
The loaded bundle.
NullPointerExceptionIf the argument is null.
BundleLoadingFailedExceptionIf the bundle couldn't be loaded by the storage view.
Gets the information about a given bundle in the storage view.

The bundle storage view will attempt to locate and load the information of the bundle for the given identifier. This may include loading the bundle itself, or only the information related meta-data. The operation is executed in an implementation dependent manner based on the storage view.

The storage view may require the bundle identifier to have a version qualifier.

bundleidThe bundle identifier to get the information for.
The bundle information for the given identifier.
NullPointerExceptionIf the argument is null.
BundleLoadingFailedExceptionIf loading the bundle information failed.
public abstract BundleStorage getStorage()
Gets the backing bundle storage object.

In general, clients don't need to use the backing storage directly.

The backing bundle storage.
Gets the storage view key of this view.
The key.
Loads the external archives from the argument dependency information.

The method works the same way as NestBundleStorageConfiguration.loadExternalArchives(ExternalDependencyInformation), however, it also takes bundle storage specific configuration into account.

E.g. if this bundle storage is a server bundle storage then the resources may be loaded from the mirrors on the associated repository server.

It can be advantageous to use this method instead of the one in NestBundleStorageConfiguration when resolving dependencies if an existing bundle, so the external dependencies are resolved in a reliable manner.

depinfoThe dependency information.
The loaded external archives. Mapped to their external archive keys.
NullPointerExceptionIf the argument is null.
IllegalArgumentExceptionIf the argument dependency information contains invalid data. (E.g. multiple different hashes are defined for a given URI.)
saker.nest 0.8.5
public abstract Map<String, ? extends Set<extends BundleIdentifier>> lookupBundleIdentifiers(String bundlename) throws NullPointerException, IllegalArgumentException
Looks up the identifiers of bundles that have the same bundle name as the argument.

This method will query all bundles that are present with the given name in this bundle storage view. The found bundle identifiers are returned in a map that contains version numbers mapped to the bundle identifiers for that version. The returned map is ordered by descending order of version numbers.

bundlenameThe bundle name to get the bundles of.
The version number-bundle identifiers map that contains the found bundles. Iteration order is descending by version number.
NullPointerExceptionIf the argument is null.
public abstract Set<extends BundleIdentifier> lookupBundleVersions(BundleIdentifier bundleid) throws NullPointerException
Looks up the identifiers of bundles which are present in this bundle storage view and only differ (or equal) in version number to the argument.

This method will search for all bundles present in the storage view with the same bundle name and qualifiers (except the version qualifier). The found bundle identifiers are returned in a set that is ordered by descending version numbers.

If the argument has a version qualifier, it is ignored by this method.

bundleidThe bundle identifier to get the available versions for.
The bundle identifiers that were found. The result is ordered by descending version numbers.
NullPointerExceptionIf the argument is null.