Class SecomSourceIndexer
- Namespace
- EncDotNet.S100.Collections.Indexing
- Assembly
- EncDotNet.S100.Collections.dll
Indexes a SecomSource (issue #804): reads the service's
GetSummary list, presenting the source's own identity when the
service asks for one (#883), and lists each data object as an online item
that downloads, through SECOM Get, into DownloadFolderFor(Uri).
public sealed class SecomSourceIndexer : ICollectionSourceIndexer
- Inheritance
-
SecomSourceIndexer
- Implements
- Inherited Members
Remarks
Summaries carry no coverage, so an object has no bounds until it is downloaded; afterwards its bounds are probed from the local copy (as for community lists, §7.4 of the design note). The fingerprint covers the listed objects and the download records, so a download re-indexes the source.
The last list read is kept in memory for a short time, so a fingerprint
check and the index that follows it share one round of requests, and on
disk, so an unreachable service still lists what it last offered (with a
warning). Large services are capped at maxItems objects; narrow the
source to an area to see the rest.
An exchange-set object (containerType 1, #916) is a package, as a
community-list entry is (§7.4): until it is downloaded it is one online
item without bounds; afterwards the current datasets of its exchange set
are indexed from the local copy and listed individually, each keeping the
object's RemoteItemLocation. Items are named from the
identifier without the generation timestamp some services append (AMSA's
NAVAREA X_2026-10-13T04:47:23Z), so names stay put across reads.
Each read resolves the source's Identity through Trust and presents that identity only; a refused identity is never followed by another (#883). What was presented, and the outcome, is recorded on the index (Presentation), with the identities the source has seen refused, which are remembered per source.
Constructors
SecomSourceIndexer(HttpClient, string?, string?, DatasetProbe?, int, TimeProvider?)
Creates an indexer.
public SecomSourceIndexer(HttpClient httpClient, string? cacheDirectory = null, string? downloadsRoot = null, DatasetProbe? probe = null, int maxItems = 5000, TimeProvider? timeProvider = null)
Parameters
httpClientHttpClientThe client used to call services.
cacheDirectorystringWhere the last list of each service is kept; null for none.
downloadsRootstringThe host's downloads root, under which objects are saved in DownloadFolderFor(Uri); null when downloads are not indexed.
probeDatasetProbeReads metadata (bounds) from downloaded objects.
maxItemsintThe most objects indexed per source.
timeProviderTimeProviderThe clock; defaults to System.
Fields
DefaultMaxItems
The default cap on objects indexed per source.
public const int DefaultMaxItems = 5000
Field Value
Properties
ReuseInterval
How long a list read from a service is reused before it is read again.
public static TimeSpan ReuseInterval { get; }
Property Value
Revocation
Checks the signers of downloaded objects for revocation (issue #833) when
their signature property is made; null skips it
and reads "revocation not checked".
public SecomRevocation? Revocation { get; init; }
Property Value
Trust
Resolves each source's Identity to the MCP identity its requests present (the HttpClient should use a handler from the same instance) and sign SECOM 2.0 requests with (#838, #883). Without it, every source reads anonymously, and a service that lists only through signed requests fails with SecomIdentityRequiredException.
public SecomServerTrust? Trust { get; init; }
Property Value
Methods
CanIndex(CollectionSource)
Returns true when this indexer handles source.
public bool CanIndex(CollectionSource source)
Parameters
sourceCollectionSource
Returns
DescribeAsync(Uri, string?, string?, CancellationToken)
Reads what the service at serviceUri offers, for
choosing a filter: object counts and sizes per product. The read is
reused by an index of the same service shortly after.
public Task<SecomServiceDescription> DescribeAsync(Uri serviceUri, string? geometryWkt = null, string? identity = null, CancellationToken cancellationToken = default)
Parameters
serviceUriUriThe service's endpoint URI.
geometryWktstringAn area to narrow the read to, or null.
identitystringcancellationTokenCancellationTokenCancels the read.
Returns
Exceptions
- HttpRequestException
The service could not be read and nothing is cached.
DownloadFolderFor(Uri)
The managed folder, relative to the downloads root, that objects of the
service at serviceUri download into: one per service,
e.g. secom/s124.ccg-gcc.gc.ca-3f2a9c1b.
public static string DownloadFolderFor(Uri serviceUri)
Parameters
serviceUriUri
Returns
GetFingerprintAsync(CollectionSource, CancellationToken)
Cheaply computes a fingerprint of the source's current state. When it equals a previous index's Fingerprint, that index is still valid. Returns null when the state cannot be determined (for example the source is unavailable).
public ValueTask<string?> GetFingerprintAsync(CollectionSource source, CancellationToken cancellationToken)
Parameters
sourceCollectionSourcecancellationTokenCancellationToken
Returns
HealthOf(SecomSource)
How the last read of source's list went, in the
terms a feed's reachability uses: when the service last answered, or
why it did not and since when, with the time of the list still served
(#932). null before the source was read this session.
public FeedHealth? HealthOf(SecomSource source)
Parameters
sourceSecomSource
Returns
IndexAsync(CollectionSource, IProgress<IndexProgress>?, CancellationToken)
Indexes source.
public ValueTask<SourceIndex> IndexAsync(CollectionSource source, IProgress<IndexProgress>? progress, CancellationToken cancellationToken)
Parameters
sourceCollectionSourceprogressIProgress<IndexProgress>cancellationTokenCancellationToken