feat(historian): typed HistorianValue contracts, IHistorianDataUpdater, IHistorianBackendProvider (no behaviour change)

Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
Joseph Doherty
2026-10-09 12:44:19 -04:00
parent a6643cedf9
commit ff7c6c531a
15 changed files with 357 additions and 65 deletions
@@ -0,0 +1,42 @@
using ZB.MOM.WW.OtOpcUa.Core.Abstractions;
using ZB.MOM.WW.OtOpcUa.Core.AlarmHistorian;
namespace ZB.MOM.WW.OtOpcUa.Runtime.Historian;
/// <summary>
/// Builds the historian seams (read, live-value write, alarm write, provisioning, optional update)
/// for one historian backend. The Host selects a provider by <see cref="Name"/>.
/// </summary>
public interface IHistorianBackendProvider
{
/// <summary>Backend name, e.g. "Gateway" or "SqlServer".</summary>
string Name { get; }
/// <summary>The value kinds this backend can store; the recorder drops other kinds at capture.</summary>
IReadOnlySet<HistorianValueKind> SupportedKinds { get; }
/// <summary>Creates the HistoryRead data source.</summary>
/// <param name="sp">Service provider.</param>
/// <returns>The data source.</returns>
IHistorianDataSource CreateDataSource(IServiceProvider sp);
/// <summary>Creates the continuous-historization live-value writer.</summary>
/// <param name="sp">Service provider.</param>
/// <returns>The value writer.</returns>
IHistorianValueWriter CreateValueWriter(IServiceProvider sp);
/// <summary>Creates the alarm-history writer.</summary>
/// <param name="sp">Service provider.</param>
/// <returns>The alarm writer.</returns>
IAlarmHistorianWriter CreateAlarmWriter(IServiceProvider sp);
/// <summary>Creates the tag auto-provisioning hook.</summary>
/// <param name="sp">Service provider.</param>
/// <returns>The provisioning hook.</returns>
IHistorianProvisioning CreateProvisioning(IServiceProvider sp);
/// <summary>Creates the HistoryUpdate capability.</summary>
/// <param name="sp">Service provider.</param>
/// <returns>The updater, or <c>null</c> when the backend does not support HistoryUpdate.</returns>
IHistorianDataUpdater? CreateUpdater(IServiceProvider sp);
}