public ValidationService(ISettingsService settingsService, INotificationClient notificationClient, INeuronGraphQueryClient neuronGraphQueryClient, IAuthorRepository authorRepository)
 {
     this.settingsService        = settingsService;
     this.notificationClient     = notificationClient;
     this.neuronGraphQueryClient = neuronGraphQueryClient;
     this.authorRepository       = authorRepository;
 }
Esempio n. 2
0
 public Worker(IServiceScopeFactory serviceScopeFactory, ILogger <Worker> logger,
               INotificationClient notificationClient)
 {
     _serviceScopeFactory = serviceScopeFactory;
     _logger             = logger;
     _notificationClient = notificationClient;
 }
 public SendSmsCommandHandlerWithWaitForPreviousSms(
     ICommandHandlerAsync <SendSmsCommand> handler,
     INotificationClient notificationClient)
 {
     _handler            = handler;
     _notificationClient = notificationClient;
 }
        public UserAccessRequestTracker(INotificationClient notificationClient, IAzureTableOperation azureTableOperation, string[] regulatoryBodyList, string scheduleTime, string timeZoneId)
            : base(notificationClient, UserAccessRequestTracker.Type)
        {
            if (azureTableOperation == null)
            {
                throw new ArgumentNullException("azureTableOperation");
            }

            if (regulatoryBodyList == null)
            {
                throw new ArgumentNullException("regulatoryBodyList");
            }

            if (string.IsNullOrWhiteSpace(scheduleTime))
            {
                throw new ArgumentException("scheduleTime");
            }

            if (string.IsNullOrWhiteSpace(timeZoneId))
            {
                this.timeZoneInfo = TimeZoneInfo.Utc;
            }

            this.azureTableOperation = azureTableOperation;
            this.regulatoryBodyList  = regulatoryBodyList;
            this.scheduleTime        = TimeSpan.Parse(scheduleTime);
            this.timeZoneInfo        = TimeZoneInfo.FindSystemTimeZoneById(timeZoneId);
        }
Esempio n. 5
0
 public AuthorApplicationService(ISettingsService settingsService, INotificationClient notificationClient, INeuronGraphQueryClient neuronGraphQueryClient, IUserRepository userRepository, IRegionPermitRepository regionPermitRepository)
 {
     this.settingsService        = settingsService;
     this.notificationClient     = notificationClient;
     this.neuronGraphQueryClient = neuronGraphQueryClient;
     this.userRepository         = userRepository;
     this.regionPermitRepository = regionPermitRepository;
 }
Esempio n. 6
0
 public RegistrationController(IHttpClientFactory httpClientFactory, GabDbContext db, IUserBL userbl, INotificationClient notificationClient, ILogger <RegistrationController> logger)
 {
     _notificationClient = notificationClient;
     _httpClientFactory  = httpClientFactory;
     _db     = db;
     _userbl = userbl;
     _logger = logger;
 }
 public GovNotifyEmailService(ILogger <GovNotifyEmailService> logger, IMatchingConfiguration configuration,
                              IEmailTemplateRepository emailTemplateRepository, INotificationClient notificationClient)
 {
     _configuration           = configuration;
     _logger                  = logger;
     _emailTemplateRepository = emailTemplateRepository;
     _notificationClient      = notificationClient;
 }
 public SendSmsCommandHandler(
     IConversationRepository conversationRepository,
     INotificationClient notificationClient,
     ISettingService settingService)
 {
     _conversationRepository = conversationRepository;
     _notificationClient     = notificationClient;
     _settingService         = settingService;
 }
 public SendNotificationTask(INotificationClient pushClient,
                             IEntityRepository <Subscription> pushSubscriptionsRepository,
                             ILogger <SendNotificationTask> logger
                             )
 {
     PushClient = pushClient;
     PushSubscriptionsRepository = pushSubscriptionsRepository;
     _logger = logger;
 }
 public override void Enable()
 {
     _enumerator         = new MMDeviceEnumerator();
     _notificationClient = new INotificationClient();
     _notifyClient       = (IMMNotificationClient)_notificationClient;
     _notificationClient.DefaultDeviceChanged += NotificationClient_DefaultDeviceChanged;
     _enumerator.RegisterEndpointNotificationCallback(_notifyClient);
     UpdatePlaybackDevice(true);
     AddTimedUpdate(TimeSpan.FromMilliseconds(10), UpdatePeakVolume);
 }
 /// <summary>
 ///     Create new instance.
 /// </summary>
 public NotifyBackgroundTask(INotificationClient notificationClient,
                             INotificationRegistrationRepository notificationRegistrationRepository,
                             ILogger <NotifyBackgroundTask <TData> > logger,
                             IUserRepository userRepository)
 {
     _notificationClient = notificationClient ?? throw new ArgumentNullException(nameof(notificationClient));
     _notificationRegistrationRepository = notificationRegistrationRepository ?? throw new ArgumentNullException(nameof(notificationRegistrationRepository));
     _logger         = logger ?? throw new ArgumentNullException(nameof(logger));
     _userRepository = userRepository ?? throw new ArgumentNullException(nameof(userRepository));
 }
Esempio n. 12
0
        protected NotificationSystem(INotificationClient notificationClient, double notificationInterval, string notificationType)
            : this(notificationClient, notificationType)
        {
            if (notificationInterval == 0 || notificationInterval > int.MaxValue)
            {
                throw new ArgumentOutOfRangeException("notificationInterval");
            }

            this.NotificationTimer.Interval  = notificationInterval;
            this.NotificationTimer.AutoReset = true;

            this.NotificationTimer.Elapsed += this.NotificationTimerElapsed;
        }
        /// <summary>
        /// Invoke process module(s)
        /// if any one of the module retuns false then alarm process
        /// will not send the information to notification engine.
        /// </summary>
        /// <param name="alarmObject"></param>
        /// <returns></returns>
        public bool Run(AlarmObject alarmObject, INotificationClient client)
        {
            bool flag = true;

            foreach (IModule module in _processModules)
            {
                //module.GetType().GetCustomAttributes(false)
                if (!module.Invoke(alarmObject, client))
                {
                    flag = false;
                }
            }
            return(flag);
        }
Esempio n. 14
0
 /// <summary>
 ///     Create new instance.
 /// </summary>
 public NotificationService(INotificationClient notificationClient,
                            INotificationRegistrationRepository notificationRegistrationRepository,
                            DispatchManager dispatchManager,
                            IUserRepository userRepository,
                            INotificationFactory notificationFactory,
                            ILogger <NotificationService> logger)
 {
     _notificationClient = notificationClient ?? throw new ArgumentNullException(nameof(notificationClient));
     _notificationRegistrationRepository = notificationRegistrationRepository ?? throw new ArgumentNullException(nameof(notificationRegistrationRepository));
     _dispatchManager     = dispatchManager ?? throw new ArgumentNullException(nameof(dispatchManager));
     _userRepository      = userRepository ?? throw new ArgumentNullException(nameof(userRepository));
     _notificationFactory = notificationFactory ?? throw new ArgumentNullException(nameof(notificationFactory));
     _logger = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Esempio n. 15
0
        }                                   //parameterless ctor is necessary to register the manager in IoC container

        #region Client Registration

        public void RegisterNotificationClient(INotificationClient notificationClient)
        {
            _ClientsLock.Wait();
            try
            {
                if (!_Clients.Contains(notificationClient))
                {
                    _Clients.Add(notificationClient);
                }
            }
            finally
            {
                _ClientsLock.Release();
            }
        }
Esempio n. 16
0
 public void UnregisterNotificationClient(INotificationClient notificationClient)
 {
     _ClientsLock.Wait();
     try
     {
         if (_Clients.Contains(notificationClient))
         {
             _Clients.Remove(notificationClient);
         }
     }
     finally
     {
         _ClientsLock.Release();
     }
 }
Esempio n. 17
0
        public AuditTracker(INotificationClient notificationClient, IAzureTableOperation azureTableOperation, double notificationInterval, int[] regionIdList)
            : base(notificationClient, notificationInterval, AuditTracker.Type)
        {
            if (azureTableOperation == null)
            {
                throw new ArgumentNullException("azureTableOperation");
            }

            if (regionIdList == null)
            {
                throw new ArgumentNullException("regionIdList");
            }

            this.azureTableOperation = azureTableOperation;
            this.regionIdList        = regionIdList;
        }
        public async Task <bool> SendUploadProcessedNotification(IUploadProcessedNotification notification,
                                                                 CancellationToken cancellationToken)
        {
            INotificationClient client = NotificationClient();

            if (notification.UploadSuccessfullyProcessed)
            {
                client.SendEmail(notification.Email, ProcessSuccessfulTemplateId());
            }
            else
            {
                client.SendEmail(notification.Email, ProcessUnsuccessfulTemplateId());
            }

            return(true);
        }
Esempio n. 19
0
        protected NotificationSystem(INotificationClient notificationClient, string notificationType)
        {
            if (notificationClient == null)
            {
                throw new ArgumentNullException("notificationClient");
            }

            if (string.IsNullOrWhiteSpace(notificationType))
            {
                throw new ArgumentException("notificationType");
            }

            this.NotificationClient     = notificationClient;
            this.NotificationSystemType = notificationType;

            // To avoid an exception that could occur on calling Start/Stop method,
            // use default interval time and notify only once if the interval is not set.
            this.NotificationTimer = new Timer();
        }
Esempio n. 20
0
        public EmailNotificationService(INotificationClient <IEmailNotification, IEmail> client,
                                        ILogger <EmailValidationService> logger,
                                        IOptions <NotificationConfiguration <UserTaskRequiredNotification> >
                                        userTaskNotificationConfiguration,
                                        IOptions <NotificationConfiguration <OptimizationFinishedNotification> >
                                        optimizationFinishedNotificationConfiguration,
                                        IOptions <NotificationConfiguration <OptimizationBegunNotification> >
                                        optimizationBegunNotificationConfiguration,
                                        IOptions <NotificationConfiguration <SeasonProductsPickedNotification> > seasonalConfig)

        {
            _client = client;
            _logger = logger;
            _userTaskNotificationConfiguration             = userTaskNotificationConfiguration;
            _optimizationFinishedNotificationConfiguration =
                optimizationFinishedNotificationConfiguration;
            _optimizationBegunNotificationConfiguration =
                optimizationBegunNotificationConfiguration;
            _seasonalConfig = seasonalConfig;
        }
        public bool Invoke(AlarmObject alarmObject, INotificationClient client)
        {
            /* if the value is null, this notification is to clear the dynamic notifications(message boards and relay switches). */
            if (alarmObject.IsDynamicNotificationCleared)
            {
                return(true);
            }

            bool hasEscalations  = false;
            bool isContactSensor = false;

            /* Make isContactSensor as true if the sensor type is contact. */
            if (AlarmHelper.IsContactSensor(alarmObject.SensorType) && alarmObject.IsInAlarmState)
            {
                isContactSensor = true;
            }


            EscalationList escalationList = new EscalationList();

            /* Loading escalation information for current object */
            escalationList.Load(new Criteria()
            {
                ID = alarmObject.EscalationProfileID
            });
            if (escalationList.Count > 0)
            {
                hasEscalations             = true;
                alarmObject.HasEscalations = true;
            }

            /*update the escalation information to alarm object*/
            if (hasEscalations)
            {
                alarmObject.StopEscalationOnExitAlarm = escalationList[0].StopEscOnSesnorNormalState;
                alarmObject.StopEscalationOnUserAck   = escalationList[0].StopEscOnUserAck;
            }
            else
            {
                alarmObject.StopEscalationOnExitAlarm = false;
                alarmObject.StopEscalationOnExitAlarm = false;
            }

            escalationList.Dispose();

            /* if the sensor has escalations or it is a contact sensor then then send to the escalation process */
            if ((hasEscalations || isContactSensor) && alarmObject.AlarmType != AlarmType.COMMUNICATIONS)
            {
                ThreadPool.QueueUserWorkItem(new EscalationProcess().DoEscalationProcess, new EscalationState()
                {
                    AlarmObject        = alarmObject,
                    NotificationClient = client,
                    EscalationList     = escalationList
                });
            }
            else
            {
                /* if the object does not has any escalation then mark it as completed.*/
                AlarmHelper.MarkAsCompleted(alarmObject, " DOES NOT have any escalations ");
            }

            /* if the sensor type is contact then return false to stop sending notification immediately.*/
            if (isContactSensor && alarmObject.AlarmType != AlarmType.COMMUNICATIONS)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
 public SceneRunner(Settings settings, INotificationClient notificationClient)
 {
     this.notificationClient = notificationClient;
       this.settings = settings;
 }
Esempio n. 23
0
 public NotificationApplicationService(INotificationClient notificationClient, ISettingsService settingsService)
 {
     AssertionConcern.AssertArgumentNotNull(notificationClient, nameof(notificationClient));
     this.notificationClient = notificationClient;
     this.settingsService    = settingsService;
 }
Esempio n. 24
0
 public StockNotificationCenter(INotificationClient client)
 {
     _client = client;
 }
Esempio n. 25
0
 public NotificationSenderJob(MailAppDbContext mailAppDbContext, INotificationClient notificationClient)
 {
     MailAppDbContext   = mailAppDbContext;
     NotificationClient = notificationClient;
 }
 public NotifyClientTests()
 {
     _notificationClient = Substitute.For <INotificationClient>();
     _sut = new NotifyClient(_notificationClient);
 }
Esempio n. 27
0
 public NotificationApplicationService(INotificationClient notificationClient = null)
 {
     this.notificationClient = notificationClient ?? Locator.Current.GetService <INotificationClient>();
 }
Esempio n. 28
0
 public EmailService(INotificationClient client)
 {
     _client = client;
 }
 public SceneRunner(INotificationClient notificationClient)
 {
     this.notificationClient = notificationClient;
 }
 public NotifyClient(INotificationClient notificationClient)
 {
     NotificationClient = notificationClient;
 }
Esempio n. 31
0
 public GovNotifyGateway(INotificationClient govNotifyClient)
 {
     _govNotifyClient = govNotifyClient;
 }
Esempio n. 32
0
 public NotificationApplicationService(INotificationClient notificationClient)
 {
     _notificationClient = notificationClient;
 }