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). It reads the hub's GET {HubUrl}/hub/agents/catalogue
(#128, MapBowireHub) and returns one
BowireCatalogueEntry per entry of every live agent;
without a hub URL 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 publishes — locked here so an installation with its own aggregator can validate it against StubResponse. 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.
Agents push their registration to the hub; the workbench polls the hub's catalogue with its existing refresh-on-interval loop, exactly like the http / consul providers. A push-notify path from hub to workbench is not part of it.
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.