Class AgentCatalogueProvider
- Namespace
- Kuestenlogik.Bowire.Catalogue.Agent
- Assembly
- Kuestenlogik.Bowire.Catalogue.Agent.dll
Sources Bowire's URL/service catalogue from a Bowire Agent hub
(#305 Phase E / depends on #128). When the hub-side aggregator
endpoint GET {HubUrl}/hub/agents/catalogue is live, this
provider returns one BowireCatalogueEntry per
registered-agent entry; until then it returns an empty list and
keeps the workbench's "no catalogue" surface intact.
public sealed class AgentCatalogueProvider : IBowireCatalogueProvider
- Inheritance
-
AgentCatalogueProvider
- Implements
- Inherited Members
Remarks
The wire shape (see AgentCatalogueProvider.HubCatalogueDocument) is the contract the hub will publish — locked here so installations can validate their own aggregator response against StubResponse before #128 ships. The provider's behaviour is intentionally simple: merge each agent's entries into the catalogue, prefix every tag with the agent's id so operators can filter to a single agent in the workbench, and surface the agent's service name as the entry label when the entry doesn't carry its own.
The bidirectional / push-delta path from the original #305 sketch (agent → hub WebSocket frames carrying catalogue diffs) is deferred. Phase E v1 is poll-based — the workbench's existing refresh-on-interval loop drives this provider exactly like the http / consul providers. Once #128 settles its hub WebSocket surface, a follow-up phase plugs a push-notify path on top.
Constructors
AgentCatalogueProvider()
Parameterless ctor for the assembly-scan discovery path. Uses the no-options defaults; the provider returns an empty list when neither HubUrl nor StubResponse is configured.
public AgentCatalogueProvider()
Properties
Id
Stable id used to select this provider in config (e.g.
"local", "http", "consul",
"kubernetes", "agent"). Compared case-insensitively
against the configured provider key.
public string Id { get; }
Property Value
Name
Human-readable provider name for the Settings → Sources tab
and startup logs (e.g. "Local file",
"HTTP endpoint", "Consul").
public string Name { get; }
Property Value
Methods
FetchAsync(CancellationToken)
Fetch the current catalogue snapshot. Called on a configurable refresh interval (default 5 minutes; see RefreshInterval) and on a manual trigger from the workbench UI.
public Task<IReadOnlyList<BowireCatalogueEntry>> FetchAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenCancellation token — refresh cycles are bounded by the configured interval, so providers should respect it to avoid piling up overlapping fetches when an upstream is slow.
Returns
- Task<IReadOnlyList<BowireCatalogueEntry>>
The list of catalogue entries currently visible to this provider. Empty list is fine (means "no entries"); throw to signal a hard fetch failure — the registry catches and surfaces it as a problem-details response on
GET /api/catalogue/entries.