public MessageResolverActor(IMessageRoutingService messageRoutingService, Mapper mapper)
     : base("MessageResolverActor")
 {
     _messageRoutingService = messageRoutingService;
     _mapper = mapper;
     Command <ResolveEmailTypeMsg>(HandleResolveEmailTypeMsg);
 }
 public static Props Props(
     IMessageRoutingService messageRoutingService,
     IAccountRepository accountRepository,
     Mapper mapper,
     IDictionary <string, bool> validationRules)
 {
     return(Akka.Actor.Props.Create(() => new MessageValidationActor(
                                        messageRoutingService, accountRepository, mapper, validationRules)
                                    ));
 }
        public MessageValidationActor(
            IMessageRoutingService messageRoutingService,
            IAccountRepository accountRepository,
            Mapper mapper,
            IDictionary <string, bool> validationRulesSettings)
            : base("MessageValidationActor")
        {
            _messageRoutingService = messageRoutingService;
            _accountRepository     = accountRepository;
            _mapper = mapper;

            _emailValidator = new EmailValidator(ConfigureValidationRules(validationRulesSettings));
            Command <ValidateEmailMsg>(HandleValidateEmailMsg);
        }
 public static Props Props(
     IMessageRoutingService messageRoutingService,
     IEmailDeliveryService emailDeliveryService,
     IAccountRepository accountRepository,
     Mapper mapper,
     int maxBatchSize,
     IDictionary <string, bool> validationRulesSettings,
     IDictionary <string, bool> handlersSettings)
 {
     return(Akka.Actor.Props.Create(() =>
                                    new MessageRoutingManagerActor(
                                        messageRoutingService,
                                        emailDeliveryService,
                                        accountRepository,
                                        mapper, maxBatchSize,
                                        validationRulesSettings,
                                        handlersSettings)
                                    ));
 }
        public MessageRoutingManagerActor(
            IMessageRoutingService messageRoutingService,
            IEmailDeliveryService emailDeliveryService,
            IAccountRepository accountRepository,
            Mapper mapper,
            int maxBatchSize,
            IDictionary <string, bool> validationRulesSettings,
            IDictionary <string, bool> handlersSettings)
            : base("MessageRoutingManagerActor")
        {
            _messageRoutingService = messageRoutingService;
            _emailDeliveryService  = emailDeliveryService;

            // Automapper is used to convert data that needs to be transmitted
            // between logical application layers.
            _mapper = mapper;

            // create child actors
            _messageResolverActor = Context.ActorOf(
                MessageResolverActor.Props(messageRoutingService, mapper),
                typeof(MessageResolverActor).Name
                );
            _messageValidationActor = Context.ActorOf(
                MessageValidationActor.Props(messageRoutingService, accountRepository, mapper, validationRulesSettings),
                typeof(MessageValidationActor).Name
                );
            _messageSendingActor = Context.ActorOf(
                MessageSendingActor.Props(emailDeliveryService, mapper, maxBatchSize),
                typeof(MessageSendingActor).Name
                );
            _messageHandlerExecutorActor = Context.ActorOf(
                MessageHandlerExecutorActor.Props(handlersSettings, mapper),
                typeof(MessageHandlerExecutorActor).Name
                );
            Command <EmailRequestMsg>(HandleEmailRequestMsg);
            Command <EmailResolvedMsg>(HandleEmailResolvedMsg);
            Command <EmailQualifyMsg>(HandleEmailQualifyMsg);
            Command <EmailDisqualifiedMsg>(HandleEmailDisqualifiedMsg);
        }
 public static Props Props(IMessageRoutingService messageRoutingService, Mapper mapper)
 {
     return(Akka.Actor.Props.Create(() => new MessageResolverActor(messageRoutingService, mapper)));
 }
 public SendEmailEventHandler(IMessageRoutingService messageRoutingService)
 {
     _messageRoutingService = messageRoutingService;
 }
 public WebHookController(IMessageRoutingService routeService, ILogger <WebHookController> toFileLogger)
 {
     _routeMessageService = routeService ?? throw new ArgumentNullException(nameof(_routeMessageService));
     _toFileLogger        = toFileLogger ?? throw new ArgumentNullException(nameof(toFileLogger));
 }