Zero Install .NET API  2.18.1
ZeroInstall.Store.Implementations.CompositeImplementationStore Class Reference

Combines multiple IImplementationStores as a composite. Adds memory caching for IImplementationStore.Contains(ManifestDigest). More...

Inheritance diagram for ZeroInstall.Store.Implementations.CompositeImplementationStore:
ZeroInstall.Store.Implementations.IImplementationStore

Public Member Functions

 CompositeImplementationStore (IEnumerable< IImplementationStore > innerStores)
 Creates a new composite implementation store with a set of IImplementationStores. More...
 
IEnumerable< ManifestDigestListAll ()
 Returns a list of all implementations currently in the store.
 
IEnumerable< string > ListAllTemp ()
 Returns a list of temporary directories currently in the store.
 
bool Contains (ManifestDigest manifestDigest)
 Determines whether the store contains a local copy of an implementation identified by a specific ManifestDigest.
 
bool Contains (string directory)
 Determines whether the store contains a specific directory.
 
void Flush ()
 Clears any in-memory caches.
 
string? GetPath (ManifestDigest manifestDigest)
 Determines the local path of an implementation with a given ManifestDigest.
 
string AddDirectory (string path, ManifestDigest manifestDigest, ITaskHandler handler)
 Copies a directory containing an implementation into the store if it matches the provided ManifestDigest.
 
string AddArchives (IEnumerable< ArchiveFileInfo > archiveInfos, ManifestDigest manifestDigest, ITaskHandler handler)
 Extracts multiple archives, that together contain the files of an implementation, into the same folder, compares that folder's manifest to manifestDigest and adds it to the store.
 
bool Remove (ManifestDigest manifestDigest, ITaskHandler handler)
 Removes a specific implementation from the cache.
 
long Optimise (ITaskHandler handler)
 Reads in all the manifest files in the store and looks for duplicates (files with the same permissions, modification time and digest). When it finds a pair, it deletes one and replaces it with a hard-link to the other.
 
void Verify (ManifestDigest manifestDigest, ITaskHandler handler)
 Recalculates the digests for an entry in the store and ensures it is correct. Will delete damaged implementations after user confirmation.
 
override string ToString ()
 Returns the names of the child stores. Not safe for parsing! More...
 

Public Attributes

IEnumerable< IImplementationStoreStores => new ReadOnlyCollection<IImplementationStore>(_innerStores)
 The IImplementationStores this store is internally composed of. More...
 
ImplementationStoreKind Kind => ImplementationStoreKind.ReadWrite
 
string? DirectoryPath => null
 

Additional Inherited Members

- Properties inherited from ZeroInstall.Store.Implementations.IImplementationStore
ImplementationStoreKind Kind [get]
 Indicates what kind of access to this store is possible. More...
 
string? DirectoryPath [get]
 The directory containing the cached Implementations. May be null for some IImplementationStore types. More...
 

Detailed Description

Combines multiple IImplementationStores as a composite. Adds memory caching for IImplementationStore.Contains(ManifestDigest).

When adding new Implementations the last child IImplementationStore that doesn't throw an UnauthorizedAccessException is used.

When when retrieving existing Implementations the first child IImplementationStore that returns true for IImplementationStore.Contains(ManifestDigest) is used.

Constructor & Destructor Documentation

◆ CompositeImplementationStore()

ZeroInstall.Store.Implementations.CompositeImplementationStore.CompositeImplementationStore ( IEnumerable< IImplementationStore innerStores)
inline

Creates a new composite implementation store with a set of IImplementationStores.

Parameters
innerStoresA priority-sorted list of IImplementationStores. Queried last-to-first for adding new Implementations, first-to-last otherwise.

Member Function Documentation

◆ ToString()

override string ZeroInstall.Store.Implementations.CompositeImplementationStore.ToString ( )

Returns the names of the child stores. Not safe for parsing!

Member Data Documentation

◆ Stores

IEnumerable<IImplementationStore> ZeroInstall.Store.Implementations.CompositeImplementationStore.Stores => new ReadOnlyCollection<IImplementationStore>(_innerStores)

The IImplementationStores this store is internally composed of.


The documentation for this class was generated from the following file: