Exemplo n.º 1
0
 public Commerce5(IBillingProcessor billingProcessor, ICustomerProcessor customer, INotificationProcessor notifier, ILoggingProcessor logger)
 {
     _BillingProcessor = billingProcessor;
     _Customer = customer;
     _Notifier = notifier;
     _Logger = logger;
 }
Exemplo n.º 2
0
 public Commerce5(IBillingProcessor billingProcessor, ICustomerProcessor customer, INotificationProcessor notifier, ILoggingProcessor logger)
 {
     _billingProcessor = billingProcessor;
     _customer         = customer;
     _notifier         = notifier;
     _logger           = logger;
 }
Exemplo n.º 3
0
 public ThermoMessageController(ILogger <ThermoMessageController> logger,
                                IDataStoreProcesor dataStoreProcesor, INotificationProcessor notificationProcesor)
 {
     _logger               = logger;
     _dataStoreProcesor    = dataStoreProcesor;
     _notificationProcesor = notificationProcesor;
 }
 public Commerce2(IBillingProcessorLocator billingProcessorLocator, ICustomerProcessor customer, INotificationProcessor notifier, ILoggingProcessor logger)
 {
     _BillingProcessorLocator = billingProcessorLocator;
     _Customer = customer;
     _Notifier = notifier;
     _Logger   = logger;
 }
        public void SetUp()
        {
            _notificationProvider = new Mock <INotificationProvider>();

            _notificationSendDirector = new Mock <INotificationSendDirector>();

            _target = new NotificationProcessor(_notificationProvider.Object, _notificationSendDirector.Object);
        }
Exemplo n.º 6
0
 public UserAppService(SchoolHubDbContext schoolHubDbContext,
                       INotificationProcessor notificationProcessor,
                       IMappingService mappingService)
 {
     _schoolHubDbContext  = schoolHubDbContext;
     _notificationProcess = notificationProcessor;
     _mappingService      = mappingService;
 }
Exemplo n.º 7
0
        public NotificationPorcessorTests()
        {
            _log            = new Mock <ISplitLogger>();
            _splitsWorker   = new Mock <ISplitsWorker>();
            _segmentsWorker = new Mock <ISegmentsWorker>();

            _notificationPorcessor = new NotificationProcessor(_splitsWorker.Object, _segmentsWorker.Object, _log.Object);
        }
Exemplo n.º 8
0
 public AuthenticationAppService(IUserAppService userAppService, SchoolHubDbContext schoolHubDbContext,
                                 INotificationProcessor notificationProcessor
                                 )
 {
     _userAppService        = userAppService;
     _schoolHubDbContext    = schoolHubDbContext;
     _notificationProcessor = notificationProcessor;
 }
Exemplo n.º 9
0
 public ScheduledFetcher(
     IEnumerable <IAppointmentSource> appointmentSources,
     IAppointmentStore appointmentStore,
     INotificationProcessor notificationProcessor)
 {
     _appointmentSources    = appointmentSources;
     _appointmentStore      = appointmentStore;
     _notificationProcessor = notificationProcessor;
 }
Exemplo n.º 10
0
 public NotificationService(
     ILogger <NotificationService> logger,
     INotificationProcessor processor,
     IConnectionSettings settings)
 {
     _logger    = logger;
     _processor = processor;
     _settings  = settings;
 }
        public NotificationProcessingJob([NotNull] INotificationProcessor notificationProcessor)
        {
            if (notificationProcessor == null)
            {
                throw new ArgumentNullException(nameof(notificationProcessor));
            }

            _notificationProcessor = notificationProcessor;
        }
Exemplo n.º 12
0
        public void ProcessOrder(OrderInfo orderInfo)
        {
            IBillingProcessor      billingProcessor      = _ProcessorLocator.GetProcessor <IBillingProcessor>();
            ICustomerProcessor     customerProcessor     = _ProcessorLocator.GetProcessor <ICustomerProcessor>();
            INotificationProcessor notificationProcessor = _ProcessorLocator.GetProcessor <INotificationProcessor>();
            ILoggingProcessor      loggingProcessor      = _ProcessorLocator.GetProcessor <ILoggingProcessor>();

            billingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);
            loggingProcessor.Log("Billing processed");
            customerProcessor.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);
            loggingProcessor.Log("Customer updated");
            notificationProcessor.SendReceipt(orderInfo);
            loggingProcessor.Log("Receipt sent");
        }
        public void Add(INotificationProcessor processor)
        {
            Log.Info().Message($"Adding NotificationProcessor \"{processor}\"").Write();
            try
            {
                Log.Debug().Message($"Calling Initialize on NotificationProcessor \"{processor}\"").Write();
                processor.Initialize();
            }
            catch (Exception e)
            {
                Log.Warn().Message($"NotificationProcessor \"{processor}\" failed to initialize. Error: \n {e}").Exception(e).Write();
            }

            Log.Debug().Message($"NotificationProcessor \"{processor}\" successfully initialized. Adding to list of processors.").Write();
            _processors.Add(processor);
        }
Exemplo n.º 14
0
        public SSEHandler(string streaminServiceUrl,
                          ISplitsWorker splitsWorker,
                          ISegmentsWorker segmentsWorker,
                          INotificationProcessor notificationPorcessor,
                          INotificationManagerKeeper notificationManagerKeeper,
                          ISplitLogger log = null,
                          IEventSourceClient eventSourceClient = null)
        {
            _streaminServiceUrl        = streaminServiceUrl;
            _splitsWorker              = splitsWorker;
            _segmentsWorker            = segmentsWorker;
            _notificationPorcessor     = notificationPorcessor;
            _notificationManagerKeeper = notificationManagerKeeper;
            _log = log ?? WrapperAdapter.GetLogger(typeof(SSEHandler));
            _eventSourceClient = eventSourceClient;

            _eventSourceClient.EventReceived += EventReceived;
            _eventSourceClient.ActionEvent   += OnAction;
        }
        public bool Remove(INotificationProcessor processor)
        {
            Log.Info().Message($"Clearing NotificationProcessors {processor}").Write();
            if (!Contains(processor))
            {
                Log.Debug().Message($"NotificationProcessor \"{processor}\" was not present within the list of processors.").Write();
                return(false);
            }

            var result = _processors.Remove(processor);

            if (!result)
            {
                Log.Debug().Message($"Removed NotificationProcessor \"{processor}\".").Write();
            }
            else
            {
                Log.Warn().Message($"Did not remove NotificationProcessor \"{processor}\" after checking if its present within the list. This might indicate concurrency problems.").Write();
            }

            return(result);
        }
Exemplo n.º 16
0
        public void ProcessOrder(OrderInfo orderInfo)
        {
            IBillingProcessor      billingProcessor      = _processorLocator.GetProcessor <IBillingProcessor>();
            ICustomerProcessor     customerProcessor     = _processorLocator.GetProcessor <ICustomerProcessor>();
            INotificationProcessor notificationProcessor = _processorLocator.GetProcessor <INotificationProcessor>();
            ILoggingProcessor      loggingProcessor      = _processorLocator.GetProcessor <ILoggingProcessor>();

            billingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);
            loggingProcessor.Log("Billing processed");
            customerProcessor.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);
            loggingProcessor.Log("Customer updated");
            notificationProcessor.SendReceipt(orderInfo);
            loggingProcessor.Log("Receipt sent");


            // Named Instance
            _plugin.DoSomething();

            // Regular Usage
            //foreach (IPostOrderPlugin plugin in _Plugins)
            //{
            //    plugin.DoSomething();
            //}
        }
Exemplo n.º 17
0
 public void Register <TMessage>(IMessageContextModelManager ctxModelManager, INotificationProcessor processor)
 {
 }
Exemplo n.º 18
0
 public NotificationInstallerShould()
 {
     _processor = BuildProcessor <Notification>();
     _services  = new ServiceCollection()
                  .AddEmitter();
 }
 public ThermoMessageController(IDataStoreProcesor dataStoreProcesor, INotificationProcessor notificationProcesor, IDataFilter notificationTrigger)
 {
     _dataStoreProcesor    = dataStoreProcesor;
     _notificationProcesor = notificationProcesor;
     _notificationTrigger  = notificationTrigger;
 }
 public NotificationConsumer(INotificationProcessor processor)
 {
     _processor = processor;
 }
 public NotificationManager(INotificationQueue queue, INotificationRepository repo, INotificationProcessor proc)
 {
     _queue = queue;
     _repository = repo;
     _onlineProcessor = proc;
 }
 public bool Contains(INotificationProcessor item) => _processors.Contains(item);
Exemplo n.º 23
0
 public NotificationController(INotificationProcessor notificationProcessor)
 {
     _notificationProcessor = notificationProcessor;
 }
Exemplo n.º 24
0
 private static IEnumerable <ICommand> Process(INotification notification, IContext context, INotificationProcessor processor, Microsoft.Extensions.Logging.ILogger log)
 {
     return(processor.Process(notification, context));
 }
Exemplo n.º 25
0
 public MessageToEmailNotificationFunction(ILogger <MessageToEmailNotificationFunction> logger, INotificationProcessor notificationMessageProcessor, IOptions <NotificationConfiguration> options)
 {
     this._logger = logger;
     this._notificationProcessor = notificationMessageProcessor;
     this._options = options.Value;
 }
Exemplo n.º 26
0
        private void Handle(object sender, BaseEvent e)
        {
            INotificationProcessor notificationProcessor = _serviceProvider.GetService <INotificationProcessor>();

            notificationProcessor.ProcessAsync(e);
        }
        private void InitializeProcessors()
        {
            if (Debug.isDebugBuild)
                _unityConsoleProcessor = new UnityConsole(new UnityConsoleOutput());

            _fileLoggerProcessor = new FileLogger(@".\", FileLoggerBufferSize, FileLoggerAutoWrites);

            _inGameConsoleProcessor = new InGameConsole(InGameConsoleContainer, InGameConsoleMaxLines, InGameConsoleClearLinesCount);
        }
Exemplo n.º 28
0
 public NotificationSimplePipeline(INotificationProcessor <TNotification> processor)
 {
     _processor = processor;
 }
Exemplo n.º 29
0
 public void Processors(ILeaveCalendarDataProcessor lcDataProcessor, ILoggingProcessor loggingProcessor, INotificationProcessor notificationProcessor)
 {
     _LeaveCalendarDataProcessor = lcDataProcessor;
     _LoggingProcessor = loggingProcessor;
     _NotificationProcessor = notificationProcessor;
 }
        private void ToggleProcessor(bool activateProcessor, INotificationProcessor processor)
        {
            if (processor == null)
                return;

            if (activateProcessor)
                _notificationRaiser.NewNotification += processor.OnNewNotification;
            else
                _notificationRaiser.NewNotification -= processor.OnNewNotification;
        }
Exemplo n.º 31
0
 public void Dispose()
 {
     _processor = null !;
     _disposed  = true;
 }
Exemplo n.º 32
0
 public UserManagerService(UserProfileDbContext userProfileDbContext, INotificationProcessor notification)
 {
     _userProfileDbContext = userProfileDbContext;
     _notification         = notification;
 }
Exemplo n.º 33
0
 public HomeController(ILeaveCalendarDataProcessor lcDataProcessor, ILoggingProcessor loggingProcessor, INotificationProcessor notificationProcessor)
 {
     _LeaveCalendarDataProcessor = lcDataProcessor;
     _LoggingProcessor = loggingProcessor;
     _NotificationProcessor = notificationProcessor;
 }