using ZB.MOM.WW.OtOpcUa.Core.Abstractions;
using ZB.MOM.WW.OtOpcUa.Core.AlarmHistorian;
namespace ZB.MOM.WW.OtOpcUa.Runtime.Historian;
///
/// Builds the historian seams (read, live-value write, alarm write, provisioning, optional update)
/// for one historian backend. The Host selects a provider by .
///
public interface IHistorianBackendProvider
{
/// Backend name, e.g. "Gateway" or "SqlServer".
string Name { get; }
/// The value kinds this backend can store; the recorder drops other kinds at capture.
IReadOnlySet SupportedKinds { get; }
/// Creates the HistoryRead data source.
/// Service provider.
/// The data source.
IHistorianDataSource CreateDataSource(IServiceProvider sp);
/// Creates the continuous-historization live-value writer.
/// Service provider.
/// The value writer.
IHistorianValueWriter CreateValueWriter(IServiceProvider sp);
/// Creates the alarm-history writer.
/// Service provider.
/// The alarm writer.
IAlarmHistorianWriter CreateAlarmWriter(IServiceProvider sp);
/// Creates the tag auto-provisioning hook.
/// Service provider.
/// The provisioning hook.
IHistorianProvisioning CreateProvisioning(IServiceProvider sp);
/// Creates the HistoryUpdate capability.
/// Service provider.
/// The updater, or null when the backend does not support HistoryUpdate.
IHistorianDataUpdater? CreateUpdater(IServiceProvider sp);
/// Creates the retention purge seam, if the backend manages retention in-process.
/// Service provider.
/// The purger, or null (default) when the backend has no retention or enforces it itself.
IHistorianRetention? CreateRetention(IServiceProvider sp) => null;
}