feat(host): wire A3 ProjectedConditionAccess (DI, node-manager sink, host condition caps)
This commit is contained in:
@@ -94,19 +94,22 @@ public sealed class ProjectedConditionAccess : IProjectedConditionAccess, IDispo
|
||||
private bool _disposed;
|
||||
|
||||
public ProjectedConditionAccess(IProjectedConditionMappings mappings, IGrpcDataAdapterConnectionSource connections,
|
||||
DataOperationPolicy policy, Func<IProjectedConditionSink?> sink, TimeProvider clock, ProjectedConditionOptions? options = null,
|
||||
DataOperationPolicy policy, Func<IProjectedConditionSink?>? sink, TimeProvider clock, ProjectedConditionOptions? options = null,
|
||||
ILogger? logger = null)
|
||||
{
|
||||
_mappings = mappings ?? throw new ArgumentNullException(nameof(mappings));
|
||||
_connections = connections ?? throw new ArgumentNullException(nameof(connections));
|
||||
_policy = policy ?? throw new ArgumentNullException(nameof(policy));
|
||||
_sink = sink ?? throw new ArgumentNullException(nameof(sink));
|
||||
_sink = sink ?? (() => Sink);
|
||||
_clock = clock ?? throw new ArgumentNullException(nameof(clock));
|
||||
_options = options ?? ProjectedConditionOptions.Default;
|
||||
_log = logger ?? NullLogger.Instance;
|
||||
_mappings.Changed += OnMappingsChanged;
|
||||
}
|
||||
|
||||
/// <summary>The node manager the host binds once the server is up (used when no sink delegate was supplied).</summary>
|
||||
public IProjectedConditionSink? Sink { get; set; }
|
||||
|
||||
/// <summary>Whether a mapping is condition-bearing: enabled, Subscribe + AlarmSubscribe granted.</summary>
|
||||
public static bool IsConditionBearing(RemoteNamespaceMapping mapping) =>
|
||||
mapping.Enabled && (mapping.AllowedOperations & (DataOperations.Subscribe | DataOperations.AlarmSubscribe))
|
||||
|
||||
Reference in New Issue
Block a user