Show / Hide Table of Contents

Class PackageCacheManager

The manager a cache of packages with a maximum cache age.

Inheritance
System.Object
PackageCacheManager
Implements
IPackageCacheManager
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Phoenix.PackageManagement
Assembly: Phoenix.Core.dll
Syntax
public class PackageCacheManager : IPackageCacheManager

Constructors

View Source

PackageCacheManager(IPhoenixLogger, ISettingsManager)

Initializes a new instance of the PackageCacheManager class.

Declaration
public PackageCacheManager(IPhoenixLogger logger, ISettingsManager settingsManager)
Parameters
Type Name Description
IPhoenixLogger logger

The logger.

ISettingsManager settingsManager

Fields

View Source

FallbackMaxAge

Gets the default maximum age for a device's packages.

Declaration
public static readonly TimeSpan FallbackMaxAge
Field Value
Type Description
System.TimeSpan

Methods

View Source

ForceCacheRefresh(IDevice)

Forces the cache to reset for the device.

Declaration
public async Task ForceCacheRefresh(IDevice device)
Parameters
Type Name Description
IDevice device

The target device.

Returns
Type Description
System.Threading.Tasks.Task

A task which performs the reset.

View Source

GetMaxAge(IDevice)

Gets the internal max cache age for a device's packages.

Declaration
public TimeSpan GetMaxAge(IDevice device)
Parameters
Type Name Description
IDevice device

The target device.

Returns
Type Description
System.TimeSpan

The max cache age.

View Source

GetPackagesAsync(IDevice)

Gets the packages for a specific device, refreshing the cache if the packages are older than the internal max cache age.

Declaration
public async Task<IList<IPackage>> GetPackagesAsync(IDevice device)
Parameters
Type Name Description
IDevice device

The target device.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IList<IPackage>>

The packages for that device.

View Source

GetPackagesAsync(IDevice, PackageFilter)

Gets a filtered set of packages for a specific device, refreshing the cache if the packages are older than the internal max cache age.

Declaration
public async Task<IList<IPackage>> GetPackagesAsync(IDevice device, PackageFilter filter)
Parameters
Type Name Description
IDevice device

The target device.

PackageFilter filter

The filter to apply.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IList<IPackage>>

The packages for that device.

View Source

GetPackagesAsync(IDevice, PackageFilter, TimeSpan)

Gets a filtered set of packages for a specific device, refreshing the cache if the packages are older than the supplied max cache age.

Declaration
public async Task<IList<IPackage>> GetPackagesAsync(IDevice device, PackageFilter filter, TimeSpan maxCacheAge)
Parameters
Type Name Description
IDevice device

The device to get the packages for.

PackageFilter filter

The filter to apply.

System.TimeSpan maxCacheAge

The maximum cache age.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IList<IPackage>>

The packages for that device.

View Source

GetPackagesAsync(IDevice, TimeSpan)

Gets the packages for a specific device, refreshing the cache if the packages are older than the supplied max cache age.

Declaration
public async Task<IList<IPackage>> GetPackagesAsync(IDevice device, TimeSpan maxCacheAge)
Parameters
Type Name Description
IDevice device

The device to get the packages for.

System.TimeSpan maxCacheAge

The maximum cache age.

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.IList<IPackage>>

The packages for that device.

View Source

SetMaxAge(IDevice, TimeSpan)

Sets the max age for a device's packages.

Declaration
public void SetMaxAge(IDevice device, TimeSpan maxAge)
Parameters
Type Name Description
IDevice device

The target device.

System.TimeSpan maxAge

The maximum age.

Implements

IPackageCacheManager
  • View Source
In This Article
Back to top Generated by DocFX