feat(dcl): BrowseNext continuation paging + StubOpcUaClient canned browse (T15)

This commit is contained in:
Joseph Doherty
2026-06-18 02:21:59 -04:00
parent 3c9122bc07
commit 2cfe0de927
8 changed files with 258 additions and 37 deletions
@@ -10,21 +10,28 @@ public interface IBrowsableDataConnection
{
/// <summary>
/// Returns the immediate children of <paramref name="parentNodeId"/>, or
/// the server's root-level nodes when null.
/// the server's root-level nodes when null. Pageable: when a prior call
/// returned a non-null <see cref="BrowseChildrenResult.ContinuationToken"/>,
/// pass it back via <paramref name="continuationToken"/> to fetch the next
/// page; a null/empty token starts a fresh browse of <paramref name="parentNodeId"/>.
/// </summary>
/// <param name="parentNodeId">Node id whose children to browse, or null for the server root (OPC UA ObjectsFolder).</param>
/// <param name="continuationToken">Opaque token from a prior <see cref="BrowseChildrenResult.ContinuationToken"/> to fetch the next page; null/empty starts a fresh browse. The token is implementation-private (e.g. a Base64 OPC UA continuation point) and must not be interpreted by callers.</param>
/// <param name="cancellationToken">Cancellation token; on cancellation the implementation should throw <see cref="OperationCanceledException"/>.</param>
/// <returns>A task that resolves to the child nodes and a flag indicating whether results were truncated.</returns>
/// <returns>A task that resolves to the child nodes, a flag indicating whether more results remain, and a continuation token to fetch the next page (null when exhausted).</returns>
Task<BrowseChildrenResult> BrowseChildrenAsync(
string? parentNodeId,
string? continuationToken = null,
CancellationToken cancellationToken = default);
}
/// <param name="Children">Child nodes returned by the server in browse order.</param>
/// <param name="Truncated">True when the server reported more children than the per-call cap; remaining children must be discovered via manual entry.</param>
/// <param name="Truncated">True when more children remain beyond this page; fetch them by passing <paramref name="ContinuationToken"/> back to <see cref="IBrowsableDataConnection.BrowseChildrenAsync"/>.</param>
/// <param name="ContinuationToken">Opaque token to fetch the next page (echo it back via the <c>continuationToken</c> parameter), or null when the browse is exhausted. Implementation-private — callers must treat it as opaque.</param>
public record BrowseChildrenResult(
IReadOnlyList<BrowseNode> Children,
bool Truncated);
bool Truncated,
string? ContinuationToken = null);
/// <param name="NodeId">Server-issued node identifier (e.g. <c>"ns=2;s=Devices.Pump1.Speed"</c>).</param>
/// <param name="DisplayName">Human-readable display name from the server's DisplayName attribute.</param>