/// <summary>
        /// Initializes a new instance of the <see cref="EvaluateReactionRegistrationProtocol"/> class.
        /// </summary>
        /// <param name="streamFactory">The protocol to get <see cref="IStream"/> from a <see cref="StreamRepresentation"/>.</param>
        public EvaluateReactionRegistrationProtocol(
            ISyncAndAsyncReturningProtocol <GetStreamFromRepresentationOp, IStream> streamFactory)
        {
            streamFactory.MustForArg(nameof(streamFactory)).NotBeNull();

            this.streamFactory = streamFactory;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GetReactionRegistrationDependenciesStatusProtocol"/> class.
        /// </summary>
        /// <param name="reactionOperationStreamFactory">The stream factory for streams used in dependencies.</param>
        public GetReactionRegistrationDependenciesStatusProtocol(
            ISyncAndAsyncReturningProtocol <GetStreamFromRepresentationOp, IStream> reactionOperationStreamFactory)
        {
            reactionOperationStreamFactory.MustForArg(nameof(reactionOperationStreamFactory)).NotBeNull();

            this.reactionOperationStreamFactory = reactionOperationStreamFactory;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CompleteHandlingOnReactionRegistrationDependenciesProtocol"/> class.
        /// </summary>
        /// <param name="reactionOperationStreamFactory">The stream factory for streams used in dependencies.</param>
        /// <param name="handlingTags">Optional tags to provide to handling entries.</param>
        public CompleteHandlingOnReactionRegistrationDependenciesProtocol(
            ISyncAndAsyncReturningProtocol <GetStreamFromRepresentationOp, IStream> reactionOperationStreamFactory,
            IReadOnlyCollection <NamedValue <string> > handlingTags = null)
        {
            reactionOperationStreamFactory.MustForArg(nameof(reactionOperationStreamFactory)).NotBeNull();

            this.reactionOperationStreamFactory = reactionOperationStreamFactory;
            this.handlingTags = handlingTags;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="WriteEventOnMatchingRecordFilterProtocol{TId}"/> class.
        /// </summary>
        /// <param name="checkRecordExistsProtocol">The check record exists protocol.</param>
        /// <param name="streamFactory">The protocol to get <see cref="IStream"/> from a <see cref="StreamRepresentation"/>.</param>
        public WriteEventOnMatchingRecordFilterProtocol(
            ISyncAndAsyncReturningProtocol <CheckRecordExistsOp, CheckRecordExistsResult> checkRecordExistsProtocol,
            ISyncAndAsyncReturningProtocol <GetStreamFromRepresentationOp, IStream> streamFactory)
        {
            checkRecordExistsProtocol.MustForArg(nameof(checkRecordExistsProtocol)).NotBeNull();
            streamFactory.MustForArg(nameof(streamFactory)).NotBeNull();

            this.checkRecordExistsProtocol = checkRecordExistsProtocol;
            this.streamFactory             = streamFactory;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RunReactorProtocol"/> class.
        /// </summary>
        /// <param name="reactionRegistrationStream">The registered reaction stream.</param>
        /// <param name="reactionStream">The reaction stream.</param>
        /// <param name="evaluateReactionRegistrationProtocol">The evaluate registered reaction protocol.</param>
        public RunReactorProtocol(
            IStandardStream reactionRegistrationStream,
            IStandardStream reactionStream,
            ISyncAndAsyncReturningProtocol <EvaluateReactionRegistrationOp, EvaluateReactionRegistrationResult> evaluateReactionRegistrationProtocol)
        {
            reactionRegistrationStream.MustForArg(nameof(reactionRegistrationStream)).NotBeNull();
            reactionStream.MustForArg(nameof(reactionStream)).NotBeNull();
            evaluateReactionRegistrationProtocol.MustForArg(nameof(evaluateReactionRegistrationProtocol)).NotBeNull();

            this.reactionRegistrationStream           = reactionRegistrationStream;
            this.reactionStream                       = reactionStream;
            this.evaluateReactionRegistrationProtocol = evaluateReactionRegistrationProtocol;
        }
Exemplo n.º 6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ExecuteOpOnScheduleProtocol"/> class.
        /// </summary>
        /// <param name="scheduleExecutionReadStream">The schedule execution read stream.</param>
        /// <param name="scheduleExecutionWriteStream">The schedule execution write stream.</param>
        /// <param name="protocolFactory">The factory to determine the appropriate protocol to execute the scheduled operation.</param>
        /// <param name="evaluateScheduleProtocol">The protocol to evaluate schedules.</param>
        public ExecuteOpOnScheduleProtocol(
            IReadOnlyStream scheduleExecutionReadStream,
            IWriteOnlyStream scheduleExecutionWriteStream,
            IProtocolFactory protocolFactory,
            ISyncAndAsyncReturningProtocol <EvaluateScheduleOp, bool> evaluateScheduleProtocol)
        {
            scheduleExecutionReadStream.MustForArg(nameof(scheduleExecutionReadStream)).NotBeNull();
            scheduleExecutionWriteStream.MustForArg(nameof(scheduleExecutionWriteStream)).NotBeNull();
            protocolFactory.MustForArg(nameof(protocolFactory)).NotBeNull();
            evaluateScheduleProtocol.MustForArg(nameof(evaluateScheduleProtocol)).NotBeNull();

            this.scheduleExecutionReadStream  = scheduleExecutionReadStream;
            this.scheduleExecutionWriteStream = scheduleExecutionWriteStream;
            this.protocolFactory          = protocolFactory;
            this.evaluateScheduleProtocol = evaluateScheduleProtocol;
        }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MemoryCachingReturningProtocol{TOperation,TReturn}"/> class.
 /// </summary>
 /// <param name="protocol">The protocol to cache.</param>
 public MemoryCachingReturningProtocol(
     ISyncAndAsyncReturningProtocol <TOperation, TReturn> protocol)
     : base(protocol)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="WriteEventsWithUtcTimestampIdProtocol"/> class.
 /// </summary>
 /// <param name="streamFactory">The protocol to get <see cref="IStream"/> from a <see cref="StreamRepresentation"/>.</param>
 public WriteEventsWithUtcTimestampIdProtocol(
     ISyncAndAsyncReturningProtocol <GetStreamFromRepresentationOp, IStream> streamFactory)
 {
     streamFactory.MustForArg(nameof(streamFactory)).NotBeNull();
     this.streamFactory = streamFactory;
 }
Exemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OperationResultCacheProtocolBase{TOperation, TReturn}"/> class.
 /// </summary>
 /// <param name="protocol">The protocol.</param>
 protected OperationResultCacheProtocolBase(
     ISyncAndAsyncReturningProtocol <TOperation, TReturn> protocol)
 {
     this.protocol = protocol ?? throw new ArgumentNullException(nameof(protocol));
 }
Exemplo n.º 10
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CheckRecordExistsProtocol"/> class.
 /// </summary>
 /// <param name="streamFactory">The protocol to get <see cref="IStream"/> from a <see cref="StreamRepresentation"/>.</param>
 public CheckRecordExistsProtocol(
     ISyncAndAsyncReturningProtocol <GetStreamFromRepresentationOp, IStream> streamFactory)
 {
     streamFactory.MustForArg(nameof(streamFactory)).NotBeNull();
     this.streamFactory = streamFactory;
 }