/* ======================================================================== * Copyright (c) 2005-2025 The OPC Foundation, Inc. All rights reserved. * * OPC Foundation MIT License 1.00 * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. * * The complete license agreement can be found here: * http://opcfoundation.org/License/MIT/1.00/ * ======================================================================*/ using System; namespace Opc.Ua.Client.Subscriptions { /// /// Subscription options /// public record class SubscriptionOptions { /// /// The subscription is disabled /// public bool Disabled { get; init; } /// /// Set keep alive count /// public uint KeepAliveCount { get; init; } /// /// The life time of the subscription in counts of /// publish interval. /// LifetimeCount shall be at least 3*KeepAliveCount. /// public uint LifetimeCount { get; init; } /// /// Set desired priority of the subscription /// public byte Priority { get; init; } /// /// Set desired publishing interval /// public TimeSpan PublishingInterval { get; init; } /// /// Set desired publishing enabled /// public bool PublishingEnabled { get; init; } /// /// Set max notifications per publish /// public uint MaxNotificationsPerPublish { get; init; } /// /// Set min lifetime interval /// public TimeSpan MinLifetimeInterval { get; init; } /// /// When the V2 manager restores this subscription via /// with /// transferSubscriptions: true, request the server to /// send the latest cached value of every monitored item as /// part of the take-over (OPC UA Part 4 §5.13.7 /// TransferSubscriptions's sendInitialValues /// argument). Defaults to false: the server only sends /// values that arrived after the subscription was suspended, /// matching the post-disconnect semantics that the V2 manager /// expects for failover-on-recreate. /// public bool SendInitialValuesOnTransfer { get; init; } /// /// Controls how the client reacts to an unsolicited /// Good_SubscriptionTransferred StatusChangeNotification /// from the server. Defaults to /// which /// matches the spec-strict behaviour (OPC UA Part 4 §5.14.7). /// Set to /// /// to automatically recreate the subscription on the same /// session when the notification arrives without the client /// having initiated a TransferSubscriptions request — this /// addresses server quirks that leave subscriptions stuck. /// public SubscriptionRecoveryPolicy RecoveryPolicy { get; init; } } }