Files
lmxopcua/src/Server/ZB.MOM.WW.OtOpcUa.Runtime/Historian/IHistorianBackendProvider.cs
T

48 lines
2.2 KiB
C#

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);
/// <summary>Creates the retention purge seam, if the backend manages retention in-process.</summary>
/// <param name="sp">Service provider.</param>
/// <returns>The purger, or <c>null</c> (default) when the backend has no retention or enforces it itself.</returns>
IHistorianRetention? CreateRetention(IServiceProvider sp) => null;
}