Table of Contents

Class HonuaFeatureGateway

Namespace
Honua.Sdk.Abstractions.Features
Assembly
Honua.Sdk.Abstractions.dll

Default IHonuaFeatureGateway that composes the registered feature query and attachment providers and routes each operation to the first provider that advertises support for it.

public sealed class HonuaFeatureGateway : IHonuaFeatureGateway, IHonuaFeatureQueryClient, IHonuaFeatureAttachmentClient
Inheritance
HonuaFeatureGateway
Implements
Inherited Members

Remarks

Attachment operations resolve over the first attachment-capable provider (for example the GeoServices FeatureServer client) even when the primary feature transport is gRPC, which exposes no attachment RPCs (native gRPC parity is tracked in geospatial-grpc#43). Query operations run on the primary provider unless the request needs a facet — a provider-neutral time filter or a grouped-statistics having clause — the primary provider does not advertise, in which case the gateway transparently routes the query to a provider that does.

Constructors

HonuaFeatureGateway(IEnumerable<IHonuaFeatureQueryClient>, IEnumerable<IHonuaFeatureAttachmentClient>)

Initializes a new instance of the HonuaFeatureGateway class.

public HonuaFeatureGateway(IEnumerable<IHonuaFeatureQueryClient> queryClients, IEnumerable<IHonuaFeatureAttachmentClient> attachmentClients)

Parameters

queryClients IEnumerable<IHonuaFeatureQueryClient>

Registered feature query providers, ordered by preference. The first entry is treated as the primary provider; later entries are fallbacks for facets the primary provider does not support.

attachmentClients IEnumerable<IHonuaFeatureAttachmentClient>

Registered feature attachment providers, ordered by preference. Attachment operations resolve to the first provider that advertises support for the requested operation.

Exceptions

ArgumentNullException

Thrown when queryClients or attachmentClients is null.

ArgumentException

Thrown when no query providers are supplied.

Properties

AttachmentCapabilities

Provider attachment capabilities exposed by this client.

public FeatureAttachmentCapabilities AttachmentCapabilities { get; }

Property Value

FeatureAttachmentCapabilities

ProviderName

Provider name for diagnostics and provider selection.

public string ProviderName { get; }

Property Value

string

QueryCapabilities

Provider query capabilities exposed by this client. A geoprocessing tool inspects these flags (for example SupportsTimeFilter or SupportsHaving) to pick a provider that supports a temporal or grouped-statistics query instead of catching a runtime NotSupportedException. The default implementation reports every facet as unsupported so providers must opt in explicitly.

public FeatureQueryCapabilities QueryCapabilities { get; }

Property Value

FeatureQueryCapabilities

Methods

AddAttachmentAsync(FeatureAttachmentAddRequest, CancellationToken)

Adds an attachment to one feature.

public Task<FeatureAttachmentResult> AddAttachmentAsync(FeatureAttachmentAddRequest request, CancellationToken cancellationToken = default)

Parameters

request FeatureAttachmentAddRequest

Provider-neutral attachment add request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureAttachmentResult>

Attachment operation result.

DeleteAttachmentAsync(FeatureAttachmentDeleteRequest, CancellationToken)

Deletes one attachment.

public Task<FeatureAttachmentResult> DeleteAttachmentAsync(FeatureAttachmentDeleteRequest request, CancellationToken cancellationToken = default)

Parameters

request FeatureAttachmentDeleteRequest

Provider-neutral attachment delete request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureAttachmentResult>

Attachment operation result.

DownloadAttachmentAsync(FeatureAttachmentDownloadRequest, CancellationToken)

Downloads one attachment.

public Task<FeatureAttachmentContent> DownloadAttachmentAsync(FeatureAttachmentDownloadRequest request, CancellationToken cancellationToken = default)

Parameters

request FeatureAttachmentDownloadRequest

Provider-neutral attachment download request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureAttachmentContent>

Downloaded attachment content. Dispose the returned content stream when finished.

ListAttachmentsAsync(FeatureAttachmentListRequest, CancellationToken)

Lists attachments for one feature.

public Task<IReadOnlyList<FeatureAttachmentInfo>> ListAttachmentsAsync(FeatureAttachmentListRequest request, CancellationToken cancellationToken = default)

Parameters

request FeatureAttachmentListRequest

Provider-neutral attachment list request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<IReadOnlyList<FeatureAttachmentInfo>>

Attachment metadata.

QueryAsync(FeatureQueryRequest, CancellationToken)

Executes a feature query and returns a single result page.

public Task<FeatureQueryResult> QueryAsync(FeatureQueryRequest request, CancellationToken cancellationToken = default)

Parameters

request FeatureQueryRequest

Provider-neutral query request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureQueryResult>

A provider-neutral result page.

QueryPagesAsync(FeatureQueryRequest, CancellationToken)

Executes a feature query and returns provider-neutral result pages.

public IAsyncEnumerable<FeatureQueryResult> QueryPagesAsync(FeatureQueryRequest request, CancellationToken cancellationToken = default)

Parameters

request FeatureQueryRequest

Provider-neutral query request.

cancellationToken CancellationToken

Cancellation token.

Returns

IAsyncEnumerable<FeatureQueryResult>

Provider-neutral result pages.

UpdateAttachmentAsync(FeatureAttachmentUpdateRequest, CancellationToken)

Updates one attachment.

public Task<FeatureAttachmentResult> UpdateAttachmentAsync(FeatureAttachmentUpdateRequest request, CancellationToken cancellationToken = default)

Parameters

request FeatureAttachmentUpdateRequest

Provider-neutral attachment update request.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<FeatureAttachmentResult>

Attachment operation result.