Table of Contents

Interface IHonuaPortalClient

Namespace
Honua.Sdk.GeoServices.Portal
Assembly
Honua.Sdk.GeoServices.dll

Typed client interface for a Honua /sharing/rest Portal facade.

public interface IHonuaPortalClient

Properties

Address

Normalized Honua root and /sharing/rest addresses for this client.

PortalAddress Address { get; }

Property Value

PortalAddress

CurrentCredential

PortalTokenCredential? CurrentCredential { get; }

Property Value

PortalTokenCredential

CurrentToken

Currently held Portal token, or null when unauthenticated.

string? CurrentToken { get; }

Property Value

string

Methods

GenerateTokenAsync(PortalGenerateTokenRequest, CancellationToken)

Exchanges username and password at POST /sharing/rest/generateToken, stores the issued token, and returns the credential with Expires in Unix milliseconds.

Task<PortalTokenCredential> GenerateTokenAsync(PortalGenerateTokenRequest request, CancellationToken cancellationToken = default)

Parameters

request PortalGenerateTokenRequest
cancellationToken CancellationToken

Returns

Task<PortalTokenCredential>

GetInfoAsync(CancellationToken)

Fetches Portal discovery and authentication metadata from GET /sharing/rest/info.

Task<PortalInfo> GetInfoAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Returns

Task<PortalInfo>

GetItemAsync(string, string?, CancellationToken)

Fetches a single sharing entry by identifier from GET /sharing/rest/content/items/{id}.

Task<PortalSharingItem> GetItemAsync(string itemId, string? token = null, CancellationToken cancellationToken = default)

Parameters

itemId string
token string
cancellationToken CancellationToken

Returns

Task<PortalSharingItem>

GetItemDataAsync(string, string?, CancellationToken)

Fetches the raw JSON data document from GET /sharing/rest/content/items/{id}/data; the caller owns and must dispose the returned document.

Task<JsonDocument> GetItemDataAsync(string itemId, string? token = null, CancellationToken cancellationToken = default)

Parameters

itemId string
token string
cancellationToken CancellationToken

Returns

Task<JsonDocument>

GetPortalSelfAsync(string?, CancellationToken)

Fetches Portal identity and caller details from GET /sharing/rest/portals/self.

Task<PortalSelf> GetPortalSelfAsync(string? token = null, CancellationToken cancellationToken = default)

Parameters

token string
cancellationToken CancellationToken

Returns

Task<PortalSelf>

OpenFeatureService(PortalSharingItem, PortalFeatureServiceOpenOptions?)

Opens a resolved Feature Service entry as an authenticated PortalFeatureServiceHandle carrying the Portal token.

PortalFeatureServiceHandle OpenFeatureService(PortalSharingItem item, PortalFeatureServiceOpenOptions? options = null)

Parameters

item PortalSharingItem
options PortalFeatureServiceOpenOptions

Returns

PortalFeatureServiceHandle

OpenFeatureServiceAsync(string, PortalFeatureServiceOpenOptions?, CancellationToken)

Fetches an entry by identifier and opens its Feature Service URL as an authenticated PortalFeatureServiceHandle carrying the Portal token.

Task<PortalFeatureServiceHandle> OpenFeatureServiceAsync(string itemId, PortalFeatureServiceOpenOptions? options = null, CancellationToken cancellationToken = default)

Parameters

itemId string
options PortalFeatureServiceOpenOptions
cancellationToken CancellationToken

Returns

Task<PortalFeatureServiceHandle>

ResolveFeatureService(PortalSharingItem)

Parses a Feature Service entry URL into its normalized GeoServices FeatureServer target.

PortalFeatureServiceResolution ResolveFeatureService(PortalSharingItem item)

Parameters

item PortalSharingItem

Returns

PortalFeatureServiceResolution

SearchAsync(PortalSearchRequest?, CancellationToken)

Fetches a single page of sharing entries from GET /sharing/rest/search.

Task<PortalSearchResponse> SearchAsync(PortalSearchRequest? request = null, CancellationToken cancellationToken = default)

Parameters

request PortalSearchRequest
cancellationToken CancellationToken

Returns

Task<PortalSearchResponse>

SearchPagesAsync(PortalSearchRequest?, CancellationToken)

Iterates paged GET /sharing/rest/search responses until the server signals nextStart = -1.

IAsyncEnumerable<PortalSearchResponse> SearchPagesAsync(PortalSearchRequest? request = null, CancellationToken cancellationToken = default)

Parameters

request PortalSearchRequest
cancellationToken CancellationToken

Returns

IAsyncEnumerable<PortalSearchResponse>

SetToken(string?)

Sets or clears the Portal token attached to subsequent authenticated requests.

void SetToken(string? token)

Parameters

token string