Files
lmxopcua/src/Core/ZB.MOM.WW.OtOpcUa.Core.Abstractions/DataConnections/ICallerAwareWriteOutcomeCapability.cs
T
Joseph Doherty 2f22003061 feat(analyzers): #1091 OTOPCUA0001 guards the caller-aware write capabilities
- ICallerAwareWritable and the new ICallerAwareWriteOutcomeCapability join the guarded-interface list. Each derives
  from a guarded interface but declares its OWN member, which is not an implementation of the base's, so
  callerAware.WriteAsync(writes, caller, ct) on an interface or concrete receiver passed unflagged.
- ICallerAwareWriteOutcomeCapability (Core.Abstractions.DataConnections): IWriteOutcomeCapability on behalf of a
  WriteCaller, for the gRPC data-connection write path (used by the Galaxy driver, next commit).
- Tests: unwrapped caller-aware WriteAsync trips on interface AND concrete receivers; the caller-aware outcome
  overload trips unwrapped and passes wrapped (positive control). Both failed (0 diagnostics) with the two
  entries removed from the list.
2026-12-04 14:58:00 -05:00

22 lines
1.6 KiB
C#

namespace ZB.MOM.WW.OtOpcUa.Core.Abstractions.DataConnections;
/// <summary>
/// #1091 — <see cref="IWriteOutcomeCapability" /> on behalf of a caller: the gRPC data-connection write path's
/// explicit-outcome overload for a driver that also acts on the caller's identity (<see cref="ICallerAwareWritable" />;
/// the Galaxy driver's SecuredWrite attributes). The runtime calls it when the admitted write carries a
/// <see cref="WriteCaller" /> (the connection's key, and only when an export covering the node opts in to secured writes,
/// #1084); a write without one goes to <see cref="IWriteOutcomeCapability.WriteWithOutcomesAsync" />. Either way the
/// driver reports each write's outcome definitively where it can (e.g. a refused secured write is
/// <see cref="DataWriteState.DriverConfirmedFailure" /> + <c>BadUserAccessDenied</c>, not <c>OutcomeUnknown</c>).
/// </summary>
public interface ICallerAwareWriteOutcomeCapability : IWriteOutcomeCapability
{
/// <summary>Write a batch on behalf of <paramref name="caller" />; one outcome per request, in order.</summary>
/// <param name="writes">Pairs of full reference + value to write.</param>
/// <param name="caller">Who issued the write.</param>
/// <param name="cancellationToken">Cancellation token; the driver should abort the batch if cancelled.</param>
/// <returns>One <see cref="DataWriteOutcome" /> per requested write, in the same order.</returns>
Task<IReadOnlyList<DataWriteOutcome>> WriteWithOutcomesAsync(
IReadOnlyList<WriteRequest> writes, WriteCaller caller, CancellationToken cancellationToken);
}