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
queryClientsIEnumerable<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.
attachmentClientsIEnumerable<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
queryClientsorattachmentClientsisnull.- ArgumentException
Thrown when no query providers are supplied.
Properties
AttachmentCapabilities
Provider attachment capabilities exposed by this client.
public FeatureAttachmentCapabilities AttachmentCapabilities { get; }
Property Value
ProviderName
Provider name for diagnostics and provider selection.
public string ProviderName { get; }
Property Value
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
Methods
AddAttachmentAsync(FeatureAttachmentAddRequest, CancellationToken)
Adds an attachment to one feature.
public Task<FeatureAttachmentResult> AddAttachmentAsync(FeatureAttachmentAddRequest request, CancellationToken cancellationToken = default)
Parameters
requestFeatureAttachmentAddRequestProvider-neutral attachment add request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<FeatureAttachmentResult>
Attachment operation result.
DeleteAttachmentAsync(FeatureAttachmentDeleteRequest, CancellationToken)
Deletes one attachment.
public Task<FeatureAttachmentResult> DeleteAttachmentAsync(FeatureAttachmentDeleteRequest request, CancellationToken cancellationToken = default)
Parameters
requestFeatureAttachmentDeleteRequestProvider-neutral attachment delete request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<FeatureAttachmentResult>
Attachment operation result.
DownloadAttachmentAsync(FeatureAttachmentDownloadRequest, CancellationToken)
Downloads one attachment.
public Task<FeatureAttachmentContent> DownloadAttachmentAsync(FeatureAttachmentDownloadRequest request, CancellationToken cancellationToken = default)
Parameters
requestFeatureAttachmentDownloadRequestProvider-neutral attachment download request.
cancellationTokenCancellationTokenCancellation 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
requestFeatureAttachmentListRequestProvider-neutral attachment list request.
cancellationTokenCancellationTokenCancellation 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
requestFeatureQueryRequestProvider-neutral query request.
cancellationTokenCancellationTokenCancellation 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
requestFeatureQueryRequestProvider-neutral query request.
cancellationTokenCancellationTokenCancellation token.
Returns
- IAsyncEnumerable<FeatureQueryResult>
Provider-neutral result pages.
UpdateAttachmentAsync(FeatureAttachmentUpdateRequest, CancellationToken)
Updates one attachment.
public Task<FeatureAttachmentResult> UpdateAttachmentAsync(FeatureAttachmentUpdateRequest request, CancellationToken cancellationToken = default)
Parameters
requestFeatureAttachmentUpdateRequestProvider-neutral attachment update request.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<FeatureAttachmentResult>
Attachment operation result.