using ZB.MOM.WW.ScadaBridge.Commons.Messages.Management;
namespace ZB.MOM.WW.ScadaBridge.CentralUI.Services;
///
/// CentralUI facade over the central-to-site OPC UA browse command. Backs the
/// OPC UA Tag Browser dialog: each tree expansion / manual node-id paste calls
/// , which forwards a
/// to the owning site via
/// .
///
///
/// The service is the trust boundary for the browse capability: it enforces the
/// Design role at central before any cross-cluster traffic is generated,
/// because site-side actors do not unwrap the central trust envelope. Transport
/// failures (timeouts, unreachable sites) are translated into a typed
/// so the dialog can render an inline error and
/// remain usable (manual node-id paste still works).
///
public interface IBrowseService
{
///
/// Enumerates the immediate children of an OPC UA node on the live server
/// backing at .
/// Pass null for to browse from the
/// server root (ObjectsFolder).
///
/// The target site identifier.
/// Name of the site-local data connection to browse against — the site's DataConnectionManagerActor indexes its children by name.
/// Node to browse, or null to browse from the server root.
/// Opaque cursor from a prior to fetch the NEXT page under ; null for the first page.
/// Cancellation token.
/// A task that resolves to a containing child nodes or a on error.
Task BrowseChildrenAsync(
string siteId,
string connectionName,
string? parentNodeId,
string? continuationToken = null,
CancellationToken cancellationToken = default);
///
/// Runs a bounded recursive search of the address space on the live server
/// backing at ,
/// returning the nodes whose DisplayName or root-relative path contains
/// . The address-space analogue of
/// : it forwards a
/// to the owning site via
/// and
/// enforces the same Design-role trust boundary at central. The depth
/// and result caps are supplied by the caller (the picker's search box) and
/// chosen to stay well under Akka's remote frame size.
///
/// The target site identifier.
/// Name of the site-local data connection to search against.
/// Case-insensitive substring matched against each node's DisplayName and root-relative path.
/// Maximum number of levels below the root to descend.
/// Maximum number of matches to return; when reached the walk stops early and the result's CapReached flag is set.
/// Cancellation token.
/// A task that resolves to a containing the matches or a on error.
Task SearchAsync(
string siteId,
string connectionName,
string query,
int maxDepth,
int maxResults,
CancellationToken cancellationToken = default);
}