using ZB.MOM.WW.OtOpcUa.Core.Abstractions.DataConnections;
namespace ZB.MOM.WW.OtOpcUa.Configuration.Entities;
/// A local realm-qualified branch projection, not a synthetic locally owned tag.
public sealed class RemoteNamespaceMapping
{
public Guid RemoteNamespaceMappingRowId { get; set; }
public string RemoteNamespaceMappingId { get; set; } = "";
public string ClusterId { get; set; } = "";
public string DataConnectionId { get; set; } = "";
public long Revision { get; set; } = 1;
public bool Enabled { get; set; }
public List ConsumerNodeIds { get; set; } = [];
public DataRealm Realm { get; set; }
public DataRealm RemoteRealm { get; set; }
public string LocalParentKind { get; set; } = "";
public string LocalParentId { get; set; } = "";
public string BranchName { get; set; } = "";
public string RemoteRootEntityId { get; set; } = "";
public string RemoteNamespaceUri { get; set; } = "";
public string RemoteIdentifierKind { get; set; } = "";
public string RemoteIdentifier { get; set; } = "";
/// Optional leaf type expectation; branch types are verified as catalog metadata arrives.
public DataValueKind? ExpectedValueKind { get; set; }
public DataValueKind? ExpectedArrayElementKind { get; set; }
public DataOperations AllowedOperations { get; set; }
public bool WriteThrough { get; set; }
public int MaxProjectionNodes { get; set; } = 10000;
public int MaxProjectionDepth { get; set; } = 32;
public int MetadataLeaseMilliseconds { get; set; } = 15000;
public int StaleTimeoutMilliseconds { get; set; } = 30000;
public int SamplingIntervalMilliseconds { get; set; } = 1000;
public int PublishingIntervalMilliseconds { get; set; } = 1000;
/// H2 (used by H3): per-request budget for assembling chunked remote Processed/AtTime answers.
public int MaxHistoryAssemblyBytesPerRequest { get; set; } = 16 * 1024 * 1024;
/// A2: conditions this mapping may import; a remote scope over it is Unavailable(ConditionCapacity) (plan ยง5.5).
public int MaxConditions { get; set; } = 1000;
/// A2: after a disconnect lasting this long, imported conditions report BadNoCommunication.
public int ConditionStaleTimeoutMilliseconds { get; set; } = 30000;
/// A2 (used by A2b): ceiling of one remote condition method call (Acknowledge, AddComment, Confirm; Shelve is not forwarded).
public int ConditionMethodTimeoutMilliseconds { get; set; } = 5000;
/// A2: how long a condition snapshot may take before the incomplete mapping is Unavailable.
public int ConditionSnapshotTimeoutMilliseconds { get; set; } = 30000;
public byte[] RowVersion { get; set; } = [];
}