using Opc.Ua;
namespace ZB.MOM.WW.OtOpcUa.Client.Shared.Adapters;
///
/// Abstracts OPC UA subscription and monitored item management.
///
internal interface ISubscriptionAdapter : IDisposable
{
///
/// Gets the server-assigned subscription identifier for diagnostics and reconnect workflows.
///
uint SubscriptionId { get; }
///
/// Adds a data-change monitored item and returns its client handle for tracking.
///
/// The node to monitor.
/// The sampling interval in milliseconds.
/// Callback when data changes. Receives (nodeIdString, DataValue).
/// Cancellation token.
/// A client handle that can be used to remove the item.
Task AddDataChangeMonitoredItemAsync(NodeId nodeId, int samplingIntervalMs,
Action onDataChange, CancellationToken ct = default);
///
/// Removes a previously added monitored item by its client handle.
///
/// The client handle returned when the monitored item was created.
/// The cancellation token that aborts the monitored-item removal.
Task RemoveMonitoredItemAsync(uint clientHandle, CancellationToken ct = default);
///
/// Adds an event monitored item with the given event filter.
///
/// The node to monitor for events.
/// The sampling interval.
/// The event filter defining which fields to select.
/// Callback when events arrive. Receives the event field list.
/// Cancellation token.
/// A client handle for the monitored item.
Task AddEventMonitoredItemAsync(NodeId nodeId, int samplingIntervalMs, EventFilter filter,
Action onEvent, CancellationToken ct = default);
///
/// Requests a condition refresh for this subscription.
///
/// The cancellation token that aborts the condition refresh request.
Task ConditionRefreshAsync(CancellationToken ct = default);
///
/// Removes all monitored items and deletes the subscription.
///
/// The cancellation token that aborts subscription deletion.
Task DeleteAsync(CancellationToken ct = default);
}