Interface IFeedManager
- Namespace
- ZeroInstall.Services.Feeds
- Assembly
- ZeroInstall.Services.dll
Provides access to remote and local Feeds. Handles downloading and signature verification.
public interface IFeedManager
- Extension Methods
Properties
this[FeedUri]
Returns a specific Feed. Automatically handles downloading, calling Normalize(FeedUri?) and caching. Updates the Stale indicator.
Feed this[FeedUri feedUri] { get; }
Parameters
feedUriFeedUriThe URI of the feed.
Property Value
Remarks
Feeds are always served from the IFeedCache if possible, unless Refresh is set to true.
Exceptions
- UriFormatException
Uri is missing or does not match
feedUri.- OperationCanceledException
The user canceled the task.
- WebException
A problem occurred while fetching the feed file.
- IOException
A problem occurred while reading the feed file.
- UnauthorizedAccessException
Access to the cache is not permitted.
- SignatureException
The signature data of a remote feed file could not be verified.
- InvalidDataException
A required property on the feed is not set or invalid.
Refresh
Set to true to re-download Feeds even if they are already in the IFeedCache.
bool Refresh { get; set; }
Property Value
ShouldRefresh
Indicates whether Stale is true and EffectiveNetworkUse is Full.
bool ShouldRefresh { get; }
Property Value
Stale
Is set to true if any Feed returned by this[FeedUri] is getting stale and should be updated by setting Refresh to true.
bool Stale { get; set; }
Property Value
Remarks
Freshness controls the time span after which a feed is considered stale.
Methods
Clear()
Clears any in-memory caches.
void Clear()
GetPreferences(FeedUri)
Returns FeedPreferences for a specific feed.
FeedPreferences GetPreferences(FeedUri feedUri)
Parameters
feedUriFeedUriThe URI of the feed.
Returns
ImportFeed(Stream, OpenPgpKeyCallback?)
Imports a remote Feed into the IFeedCache after verifying its signature.
void ImportFeed(Stream stream, OpenPgpKeyCallback? keyCallback = null)
Parameters
streamStreamThe content of the feed file.
keyCallbackOpenPgpKeyCallbackCallback for reading a specific OpenPGP public key file.
Exceptions
- IOException
A problem occurred while reading the feed file.
- UnauthorizedAccessException
Access to the feed file or the cache is not permitted.
- InvalidDataException
A problem occurred while deserializing an XML file.
- SignatureException
The signature data of the feed file could not be handled or no signatures were trusted.
IsStale(FeedUri)
Determines whether there is a stale cached copy of a particular feed.
bool IsStale(FeedUri feedUri)
Parameters
feedUriFeedUriThe URI of the feed.
Returns
- bool
trueif there is a stale copy in the cache or no copy at all;falseif there is a fresh copy in the cache.
RateLimit(FeedUri)
Ensures that operations regarding a specific feed do not happen to often in a row.
bool RateLimit(FeedUri feedUri)
Parameters
feedUriFeedUriThe URI of the feed.
Returns
- bool
trueif the operation should be skipped due to rate limiting;falseif the operation may proceed.