| | | 1 | | // The message payload defines different types of payloads carried by messages. |
| | | 2 | | |
| | | 3 | | using System; |
| | | 4 | | |
| | | 5 | | // The payload carries the sub-interceptor that is requesting a parent interceptor or IADS for a new |
| | | 6 | | // target assignment. |
| | | 7 | | public sealed class AssignTargetRequestPayload : IMessagePayload { |
| | | 8 | | public IInterceptor SubInterceptor { get; } |
| | | 9 | | |
| | | 10 | | public AssignTargetRequestPayload(IInterceptor subInterceptor) { |
| | | 11 | | SubInterceptor = subInterceptor ?? throw new ArgumentNullException(nameof(subInterceptor)); |
| | | 12 | | } |
| | | 13 | | } |
| | | 14 | | |
| | | 15 | | // The payload carries the target that a parent interceptor or IADS has selected for a requesting |
| | | 16 | | // sub-interceptor. |
| | | 17 | | public sealed class AssignTargetResponsePayload : IMessagePayload { |
| | 0 | 18 | | public IHierarchical Target { get; } |
| | | 19 | | |
| | 0 | 20 | | public AssignTargetResponsePayload(IHierarchical target) { |
| | 0 | 21 | | Target = target ?? throw new ArgumentNullException(nameof(target)); |
| | 0 | 22 | | } |
| | | 23 | | } |
| | | 24 | | |
| | | 25 | | // The payload carries the target that a sub-interceptor is requesting its parent interceptor or |
| | | 26 | | // IADS to reassign. |
| | | 27 | | public sealed class ReassignTargetRequestPayload : IMessagePayload { |
| | | 28 | | public IHierarchical Target { get; } |
| | | 29 | | |
| | | 30 | | public ReassignTargetRequestPayload(IHierarchical target) { |
| | | 31 | | Target = target ?? throw new ArgumentNullException(nameof(target)); |
| | | 32 | | } |
| | | 33 | | } |