feat(dcl): bounded recursive OPC UA address-space search adapter (T15)

This commit is contained in:
Joseph Doherty
2026-06-18 02:45:01 -04:00
parent 9ec2450ad5
commit c00c8241b3
5 changed files with 308 additions and 1 deletions
@@ -17,7 +17,7 @@ namespace ZB.MOM.WW.ScadaBridge.DataConnectionLayer.Adapters;
/// - Read/Write → Read/Write service calls
/// - Quality → OPC UA StatusCode mapping
/// </summary>
public class OpcUaDataConnection : IDataConnection, IBrowsableDataConnection, IAlarmSubscribableConnection
public class OpcUaDataConnection : IDataConnection, IBrowsableDataConnection, IAlarmSubscribableConnection, IAddressSpaceSearchable
{
private readonly IOpcUaClientFactory _clientFactory;
private readonly ILogger<OpcUaDataConnection> _logger;
@@ -302,6 +302,19 @@ public class OpcUaDataConnection : IDataConnection, IBrowsableDataConnection, IA
CancellationToken cancellationToken = default)
=> _client!.BrowseChildrenAsync(parentNodeId, continuationToken, cancellationToken);
/// <inheritdoc />
public Task<AddressSpaceSearchResult> SearchAddressSpaceAsync(
string query, int maxDepth, int maxResults, CancellationToken cancellationToken = default)
{
// Guard connection state with the typed ConnectionNotConnectedException so
// the site-side handler can map it uniformly (mirrors BrowseChildrenAsync,
// whose underlying client throws the same type when the session is down).
if (_client == null || !_client.IsConnected)
throw new ConnectionNotConnectedException("OPC UA client is not connected.");
return _client.SearchAddressSpaceAsync(query, maxDepth, maxResults, cancellationToken);
}
/// <inheritdoc />
public async Task<bool> WriteBatchAndWaitAsync(
IDictionary<string, object?> values, string flagPath, object? flagValue,