9cad9ed0fc
v2-ci / build (push) Failing after 41s
v2-ci / unit-tests (tests/Core/ZB.MOM.WW.OtOpcUa.Cluster.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.ControlPlane.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests) (push) Has been skipped
v2-ci / unit-tests (tests/Server/ZB.MOM.WW.OtOpcUa.Security.Tests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.Host.IntegrationTests) (push) Has been skipped
v2-ci / integration (tests/Server/ZB.MOM.WW.OtOpcUa.OpcUaServer.IntegrationTests) (push) Has been skipped
Adds <summary>/<param>/<returns>/<inheritdoc> where missing and removes project bookkeeping IDs (task/tracking refs) from shipped code comments, so the docs read cleanly and CommentChecker is quiet except for known false positives (PLC/protocol terms, event/IEqualityComparer inheritdoc). Doc/comment-only; no logic changed; solution builds clean.
32 lines
1.8 KiB
C#
32 lines
1.8 KiB
C#
namespace ZB.MOM.WW.OtOpcUa.Core.Abstractions;
|
|
|
|
/// <summary>
|
|
/// Test-connect probe for one driver type. Implementations deserialize a driver-config
|
|
/// JSON, attempt a cheap connection (TCP open, OPC UA session, gRPC ping — whatever the
|
|
/// driver's native protocol supports), and report success/failure with latency. Probes
|
|
/// MUST NOT mutate any persistent state; the AdminUI invokes them against transient
|
|
/// config from the typed form, NOT against the persisted DriverInstance row.
|
|
/// </summary>
|
|
public interface IDriverProbe
|
|
{
|
|
/// <summary>DriverInstance.DriverType string this probe handles. Used for DI lookup.</summary>
|
|
string DriverType { get; }
|
|
|
|
/// <summary>
|
|
/// Run the probe with the supplied config + timeout. Honour <paramref name="ct"/> for
|
|
/// timeout cancellation. Never throw on connection failure; instead return a result
|
|
/// with <c>Ok = false</c> + a message.
|
|
/// </summary>
|
|
/// <param name="configJson">The driver-specific configuration JSON to probe with.</param>
|
|
/// <param name="timeout">The maximum time to allow the probe to run.</param>
|
|
/// <param name="ct">Cancellation token for the operation.</param>
|
|
/// <returns>The probe outcome, including success/failure and latency.</returns>
|
|
Task<DriverProbeResult> ProbeAsync(string configJson, TimeSpan timeout, CancellationToken ct);
|
|
}
|
|
|
|
/// <summary>Outcome of a single <see cref="IDriverProbe.ProbeAsync"/> call.</summary>
|
|
/// <param name="Ok">True iff the probe reached its target and the handshake succeeded.</param>
|
|
/// <param name="Message">Human-readable status; null on success.</param>
|
|
/// <param name="Latency">Wall-clock duration of the successful probe; null on failure.</param>
|
|
public sealed record DriverProbeResult(bool Ok, string? Message, TimeSpan? Latency);
|