コード例 #1
0
 public NotificationPipeline(Guid id,
                             INotificationConditionFactory conditionFactory, INotificationActorFactory actorFactory, ILogger <NotificationPipeline> logger
                             ) : base(id)
 {
     _logger           = logger ?? throw new ArgumentNullException(nameof(logger));
     _conditionFactory = conditionFactory;
     _actorFactory     = actorFactory;
 }
コード例 #2
0
 public CreateNotificationPipelineCommandHandler(
     INotificationEngine engine,
     INotificationConditionFactory conditionFactory,
     INotificationActorFactory actorFactory,
     ILoggerFactory loggerFactory,
     ILogger <CreateNotificationPipelineCommandHandler> logger)
 {
     this._engine           = engine ?? throw new ArgumentNullException(nameof(engine));
     this._conditionFactory = conditionFactory;
     this._actorFactory     = actorFactory;
     this._loggerFactory    = loggerFactory ?? throw new ArgumentNullException(nameof(loggerFactory));
     this._logger           = logger ?? throw new ArgumentNullException(nameof(logger));
 }
コード例 #3
0
        public static NotificationPipeline Create(NotificationPipelineName name, NotificationPipelineDescription description,
                                                  String triggerTypeIdentifier, NotificationCondition conndition, NotificationActor actor,
                                                  ILogger <NotificationPipeline> logger, INotificationConditionFactory conditionFactory, INotificationActorFactory actorFactory)
        {
            if (conndition == null)
            {
                conndition = NotificationCondition.True;
            }
            Guid id = Guid.NewGuid();

            var pipeline = new NotificationPipeline(id, conditionFactory, actorFactory, logger);

            pipeline.Apply(new NotificationPipelineCreatedEvent
            {
                Id                  = id,
                Name                = name,
                Description         = description,
                TriggerIdentifier   = triggerTypeIdentifier,
                ConditionCreateInfo = conndition.ToCreateModel(),
                ActorCreateInfo     = actor.ToCreateModel(),
            });

            return(pipeline);
        }