namespace ZB.MOM.WW.OtOpcUa.Core.Abstractions; /// /// Optional driver capability that maps a per-tag full reference to the underlying host /// name responsible for serving it. Drivers with a one-host topology (Galaxy on one /// MXAccess endpoint, OpcUaClient against one remote server, S7 against one PLC) do NOT /// need to implement this — the dispatch layer falls back to /// as a single-host key. /// /// /// Multi-host drivers (Modbus with N PLCs, hypothetical AB CIP across a rack, etc.) /// implement this so the Phase 6.1 resilience pipeline can be keyed on /// (DriverInstanceId, ResolvedHostName, DriverCapability) per decision #144. One /// dead PLC behind a multi-device Modbus driver then trips only its own breaker; healthy /// siblings keep serving. /// /// Implementations must be fast + allocation-free on the hot path — ReadAsync /// / WriteAsync call this once per tag. A simple Dictionary<string, string> /// lookup is typical. /// /// When the fullRef doesn't map to a known host (caller passes an unregistered /// reference, or the tag was removed mid-flight), implementations should return the /// driver's default-host string rather than throwing — the invoker falls back to a /// single-host pipeline for that call, which is safer than tearing down the request. /// public interface IPerCallHostResolver { /// /// Resolve the host name for the given driver-side full reference. Returned value is /// used as the hostName argument to the Phase 6.1 CapabilityInvoker so /// per-host breaker isolation + per-host bulkhead accounting both kick in. /// string ResolveHost(string fullReference); }