feat(commons): IAlarmSubscribableConnection seam + DCL native alarm messages
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
using ZB.MOM.WW.ScadaBridge.Commons.Types.Alarms;
|
||||
|
||||
namespace ZB.MOM.WW.ScadaBridge.Commons.Interfaces.Protocol;
|
||||
|
||||
/// <summary>Callback invoked when a native alarm transition (incl. snapshot replay) arrives.</summary>
|
||||
/// <param name="transition">The protocol-neutral transition emitted by the adapter.</param>
|
||||
public delegate void AlarmTransitionCallback(NativeAlarmTransition transition);
|
||||
|
||||
/// <summary>
|
||||
/// Optional capability for an <see cref="IDataConnection"/> implementation that
|
||||
/// can mirror a source's native alarms (OPC UA Alarms & Conditions, MxAccess
|
||||
/// Gateway StreamAlarms). Mirrors the <see cref="IBrowsableDataConnection"/>
|
||||
/// capability-interface pattern; consumed by the DataConnectionActor only.
|
||||
/// </summary>
|
||||
public interface IAlarmSubscribableConnection
|
||||
{
|
||||
/// <summary>
|
||||
/// Subscribes to native alarm transitions for the conditions under
|
||||
/// <paramref name="sourceReference"/>. The adapter replays a snapshot of
|
||||
/// currently-active conditions (Snapshot…SnapshotComplete) on every
|
||||
/// (re)subscribe. Returns a subscription id for <see cref="UnsubscribeAlarmsAsync"/>.
|
||||
/// </summary>
|
||||
Task<string> SubscribeAlarmsAsync(string sourceReference, string? conditionFilter,
|
||||
AlarmTransitionCallback callback, CancellationToken cancellationToken = default);
|
||||
|
||||
/// <summary>Cancels an active alarm subscription by its id.</summary>
|
||||
Task UnsubscribeAlarmsAsync(string subscriptionId, CancellationToken cancellationToken = default);
|
||||
}
|
||||
Reference in New Issue
Block a user