namespace MxGateway.Server.Configuration;
///
/// Per-gateway alarm-subsystem configuration. Drives the auto-subscribe
/// hook in : when
/// is true and a session reaches Ready, the
/// manager issues a SubscribeAlarmsCommand to the worker with
/// the configured .
///
///
/// Defaults preserve current behaviour (alarms disabled). Operators
/// opt in by setting MxGateway:Alarms:Enabled = true and
/// supplying a canonical
/// \\<machine>\Galaxy!<area> subscription
/// expression. The literal "Galaxy" provider is correct regardless of
/// the configured Galaxy database name (the wnwrap consumer doesn't
/// accept the database name as the provider).
///
public sealed class AlarmsOptions
{
/// Gate the auto-subscribe hook on session open. Default false.
public bool Enabled { get; init; }
///
/// AVEVA alarm-subscription expression. When empty and
/// is true, the gateway falls back to
/// \\$(MachineName)\Galaxy!$(DefaultArea) if
/// is set; otherwise the session open
/// fails with a configuration diagnostic.
///
public string SubscriptionExpression { get; init; } = string.Empty;
///
/// Optional area name used to compose a default subscription when
/// is empty. Combined with
/// Environment.MachineName as
/// \\<MachineName>\Galaxy!<DefaultArea>.
///
public string DefaultArea { get; init; } = string.Empty;
///
/// If true, an auto-subscribe failure faults the session. If false
/// (default), the failure is logged and the session remains Ready —
/// alarm-side commands return "not subscribed" but data subscriptions
/// work normally.
///
public bool RequireSubscribeOnOpen { get; init; }
}