public NotificationService( INotificationStore store, INotificationSender sender) { _store = store; _sender = sender; }
public VpnReconnector(IAppSettings appSettings, ISimilarServerCandidatesGenerator similarServerCandidatesGenerator, IModals modals, IPopupWindows popups, IVpnConnector vpnConnector, INotificationSender notificationSender, ILogger logger, ServerCandidatesFactory serverCandidatesFactory, Common.Configuration.Config config, Lazy <ConnectionStatusViewModel> connectionStatusViewModel, ServerManager serverManager, Lazy <ServerConnector> serverConnector, Lazy <ProfileConnector> profileConnector) { _appSettings = appSettings; _similarServerCandidatesGenerator = similarServerCandidatesGenerator; _modals = modals; _popups = popups; _vpnConnector = vpnConnector; _notificationSender = notificationSender; _logger = logger; _serverCandidatesFactory = serverCandidatesFactory; _config = config; _connectionStatusViewModel = connectionStatusViewModel; _serverManager = serverManager; _serverConnector = serverConnector; _profileConnector = profileConnector; }
public DeactivateProductInteractor( IProductRepository productRepository, INotificationSender notificationSender) { this.productRepository = productRepository; this.notificationSender = notificationSender; }
public MessagesController(IMessageRepository messageRepository, INotificationSender notificationSender, IOptions <MqSettings> mqSettings, ILogger <MessagesController> logger) { this.messageRepository = messageRepository; this.notificationSender = notificationSender; this.mqSettings = mqSettings; this.logger = logger; }
public SubmissionsManager( IMapper mapper, IContactRepository contactRepository, ITemplateProviderResolver templateProviderResolver, ICaseRepository caseRepository, ITransformator transformator, INotificationSender notificationSender, ITaskRepository taskRepository, ITeamRepository teamRepository, ISupplierRepository supplierRepository, ISearchEngine searchEngine, ISupportsService supportsService, IPrintRequestsRepository printingRepository, IPdfGenerator pdfGenerator) { this.mapper = mapper; this.contactRepository = contactRepository; this.templateProviderResolver = templateProviderResolver; this.caseRepository = caseRepository; this.transformator = transformator; this.notificationSender = notificationSender; this.taskRepository = taskRepository; this.teamRepository = teamRepository; this.supplierRepository = supplierRepository; this.searchEngine = searchEngine; this.supportsService = supportsService; this.printingRepository = printingRepository; this.pdfGenerator = pdfGenerator; this.evacuationFileLoader = new EvacuationFileLoader(mapper, teamRepository, taskRepository, supplierRepository); }
/// <summary>Initializes this object.</summary> public static void Initialize() { if (!_initialized) { lock (_initializationLock) { if (!_initialized) { try { _sessionManager = new SessionManager(); _notificationSender = new NotificationSender(_sessionManager); _t2gManager = T2GManagerContainer.T2GManager; _transmitThread = new Thread(new ThreadStart(OnTransmitEvent)); _transmitThread.Name = "Journ. Transmit"; _t2gManager.SubscribeToElementChangeNotification(SubscriberId, new EventHandler <ElementEventArgs>(OnElementInfoChanged)); _t2gManager.SubscribeToFilePublishedNotification(SubscriberId, new EventHandler <FilePublishedNotificationArgs>(OnFilesPublished)); _t2gManager.SubscribeToFileReceivedNotification(SubscriberId, new EventHandler <FileReceivedArgs>(OnFileReceived)); _transmitThread.Start(); } catch (System.Exception e) { LogManager.WriteLog(TraceType.ERROR, e.Message, "PIS.Ground.Infotainment.Journaling.JournalingService.Initialize", e, EventIdEnum.InfotainmentJournaling); } _initialized = true; } } } }
/// <summary> /// 派发观察者消息 /// </summary> /// <param name="target"></param> /// <param name="noticeName"></param> /// <param name="notice"></param> public static void Dispatch(this INotificationSender target, int noticeName, INoticeBase <int> notice = default) { bool defaultNotice = notice == default; if (defaultNotice) { notice = Pooling <Notice> .From(); } else { } notice.SetNoticeName(noticeName); notice.NotifcationSender = target; NotificatonsInt.Instance.Notificater.Dispatch(notice); if (defaultNotice) { Pooling <Notice> .To(notice as Notice); } else { } }
public InvitationEventConsumer(INotificationSender emailSender, IUserResolver userResolver, ISemanticLog log) { this.emailSender = emailSender; this.userResolver = userResolver; this.log = log; }
public DeviceHubService(ILogger <DeviceHubService> logger, IDeviceHistoryRepository deviceHistoryRepository, IDeviceService deviceService, IHubContext <WebHubService> webHubContext, RedisStore rediscache, IBackgroundTaskQueue queue, BadDisconnectSocketService badDisconnectSocketService, IMemoryCache memoryCache, INotificationSender notificationSenderExtention) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _deviceHistoryRepository = deviceHistoryRepository ?? throw new ArgumentNullException(nameof(deviceHistoryRepository)); _deviceService = deviceService ?? throw new ArgumentNullException(nameof(deviceService)); _webHubContext = webHubContext ?? throw new ArgumentNullException(nameof(webHubContext)); _rediscache = rediscache.RedisCache ?? throw new ArgumentNullException(nameof(rediscache)); Queue = queue ?? throw new ArgumentNullException(nameof(queue)); _notificationSenderExtention = notificationSenderExtention ?? throw new ArgumentNullException(nameof(notificationSenderExtention)); _badDisconnectSocketService = badDisconnectSocketService ?? throw new ArgumentNullException(nameof(badDisconnectSocketService)); _memoryCache = memoryCache ?? throw new ArgumentNullException(nameof(memoryCache)); }
/// <summary> /// Acknowledges notifications by a sender and given filter /// </summary> private void AcknowledgeByFilter(INotificationSender sender, Predicate <NotificationMap> filter) { _listLock.EnterWriteLock(); var publishes = _published.Where(m => filter(m)).ToArray(); _published.RemoveAll(filter); _pendingPubs.RemoveAll(filter); foreach (var published in publishes) { var managed = (IManagedNotification)published.Notification; managed.Acknowledged = DateTime.Now; managed.Acknowledger = sender.Identifier; _pendingAcks.Add(published); } _listLock.ExitWriteLock(); foreach (var published in publishes) { Acknowledged?.Invoke(this, published.Notification); } }
public static void Initialize() { if (!_initialized) { lock (_initializationLock) { if (!_initialized) { try { _sessionManager = new SessionManager(); _notificationSender = new NotificationSender(_sessionManager); _t2gManager = T2GManagerContainer.T2GManager; CommonInitialize(); _initialized = true; } catch (System.Exception e) { LogManager.WriteLog(TraceType.ERROR, e.Message, "PIS.Ground.Session.SessionService.Initialize", e, EventIdEnum.Session); Uninitialize(); } } } } }
/// <summary> /// Initializes a new instance of the <see cref="SessionService"/> class. /// </summary> /// <param name="sessionManager">The session manager.</param> /// <param name="t2gManager">The T2G manager.</param> /// <param name="notificationSender">The notification sender.</param> /// <exception cref="ArgumentNullException"> /// sessionManager /// or /// t2gManager /// or /// notificationSender is null. /// </exception> protected SessionService(ISessionManager sessionManager, IT2GManager t2gManager, INotificationSender notificationSender) { if (sessionManager == null) { throw new ArgumentNullException("sessionManager"); } else if (t2gManager == null) { throw new ArgumentNullException("t2gManager"); } else if (notificationSender == null) { throw new ArgumentNullException("notificationSender"); } lock (_initializationLock) { Uninitialize(); _sessionManager = sessionManager; _t2gManager = t2gManager; _notificationSender = notificationSender; CommonInitialize(); _initialized = true; } }
public WorkflowApplier(NiisWebContext context, ITaskRegister <Domain.Entities.Contract.Contract> taskRegister, INotificationSender notificationSender, ICalendarProvider calendarProvider) { _context = context; _taskRegister = taskRegister; _notificationSender = notificationSender; _calendarProvider = calendarProvider; }
public WorkflowApplier( NiisWebContext context, INotificationSender notificationSender) { _context = context; _notificationSender = notificationSender; }
/// <summary>Uninitializes this object.</summary> /// <param name="force">Indicates if the uninitialization shall be forced.</param> private static void Uninitialize(bool force) { lock (_initializationLock) { if (_initializationCount < 2 || force) { IDisposable disposable = _requestProcessor as IDisposable; if (disposable != null) { disposable.Dispose(); } if (_t2gManager != null) { _t2gManager.Dispose(); _t2gManager = null; } _remoteDataStoreFactory = null; _rtpisDataStore = null; _sessionManager = null; _notificationSender = null; _instanceCreator = null; _requestProcessor = null; } } if (_initializationCount != 0 && !force) { _initializationCount--; } }
public PhotosController(IPhotoRepository photoRepository, IUserRepository userRepository, ILogger logger, INotificationSender notificationSender) { this.photoRepository = photoRepository; this.userRepository = userRepository; this.logger = logger; this.notificationSender = notificationSender; }
public UsageNotifierGrain(IGrainState <State> state, INotificationSender notificationSender, IUserResolver userResolver, IClock clock) { this.state = state; this.notificationSender = notificationSender; this.userResolver = userResolver; this.clock = clock; }
public BasicNotificationHandler(AppDataContext dataContext, INotificationSender notificationSender, ILogger <INotificationHandler> logger) : base(dataContext) { // TODO use database and logger _notificationSender = notificationSender; _logger = logger; }
/// <summary> /// /// </summary> /// <param name="logger"></param> /// <param name="httpService"></param> /// <param name="deviceRepository"></param> public DeviceService(ILogger <DeviceService> logger, IHttpService httpService, IDeviceRepository deviceRepository, IValidationHelper validationHelper, IHubContext <WebHubService> webHubContext, IDeviceHistoryRepository deviceHistoryRepository, INotificationSender notificationSenderExtention) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _httpService = httpService ?? throw new ArgumentNullException(nameof(httpService)); _deviceRepository = deviceRepository ?? throw new ArgumentNullException(nameof(deviceRepository)); _validationHelper = validationHelper ?? throw new ArgumentNullException(nameof(validationHelper)); _webHubContext = webHubContext ?? throw new ArgumentNullException(nameof(webHubContext)); _deviceHistoryRepository = deviceHistoryRepository ?? throw new ArgumentNullException(nameof(deviceHistoryRepository)); _notificationSenderExtention = notificationSenderExtention ?? throw new ArgumentNullException(nameof(notificationSenderExtention)); FillSortingRules(); }
public OrderModuleController(ICustomerOrderService customerOrderService, ICustomerOrderSearchService searchService, IStoreService storeService , IUniqueNumberGenerator numberGenerator , IPlatformMemoryCache platformMemoryCache , Func <IOrderRepository> repositoryFactory //, IPermissionScopeService permissionScopeService //, ISecurityService securityService , ICustomerOrderBuilder customerOrderBuilder , IShoppingCartService cartService , INotificationSender notificationSender , IChangeLogService changeLogService, INotificationTemplateRenderer notificationTemplateRenderer) { _customerOrderService = customerOrderService; _searchService = searchService; _uniqueNumberGenerator = numberGenerator; _storeService = storeService; _platformMemoryCache = platformMemoryCache; _repositoryFactory = repositoryFactory; //_securityService = securityService; //_permissionScopeService = permissionScopeService; _customerOrderBuilder = customerOrderBuilder; _cartService = cartService; _notificationSender = notificationSender; _changeLogService = changeLogService; _notificationTemplateRenderer = notificationTemplateRenderer; }
public DesignsController(IDbContextFetcher dbContextFetcher, UserManager <MoxUser> userManager, IHostingEnvironment hostingEnvironment, INotificationSender notificationSender) { this._context = dbContextFetcher.FetchDbContext <Data.IDesignDbContext>(); this._userManager = userManager; this._hostingEnvironment = hostingEnvironment; this._notificationSender = notificationSender; }
public UserCreateSendWelcomeEventHandler( INotificationSender notificationSender, INotificationSubscriptionManager notificationSubscriptionManager ) { _notificationSender = notificationSender; _notificationSubscriptionManager = notificationSubscriptionManager; }
public NotificationSession( INotificationPacketBuilder packetBuilder, INotificationSender notificationSender ) { _packetBuilder = packetBuilder; _notificationSender = notificationSender; }
public ChangeController(MongoContext <Product> products, MongoContext <User> users, INotificationSender notificationSender) { _products = products; _users = users; _notificationSender = notificationSender; ChangeTracked += ChangeTrackedHandler; }
public void Dispose() { NoticeCount = 0; mHandler = default; Name = default; Sender = default; }
public UserStorageServiceMaster(IUserRepository userRepository, IEnumerable <INotificationReceiver> receivers) : base(userRepository) { notificationSender = new CompositeNotificationSender(receivers); idGenerator = new IdGenerator(userRepository.LastId); userValidator = new UserValidator(); }
public ReviewSessionManager(INotificationGenerator generator, INotificationSender sender, IReviewSessionRepository repository, IReviewSessionMonitor monitor) { _generator = generator; _sender = sender; _monitor = monitor; _repository = repository; }
public void Add(INotificationSender sender, Action <INoticeBase <NameT> > handler) { if (mHandlersWithSender != null) { NoticeHandler <NameT> noticeHolder; if (!mHandlersWithSender.IsContainsKey(sender)) { noticeHolder = NoticeHandler <NameT> .Create(default, sender);
public QueryHandler(NiisWebContext context, IDocumentGeneratorFactory templateGeneratorFactory, INotificationSender notificationSender) { _context = context; _templateGeneratorFactory = templateGeneratorFactory; _notificationSender = notificationSender; }
public NotificationsService( ILogger <NotificationsService> logger, INotificationSender notificationSender ) { _logger = logger; _notificationSender = notificationSender; }
public Program(ProgramArguments args, ILogger logger, IArticleReader reader, IArticleRenderer renderer, IDeCorrespondentResources decorrespondent, ILastDatasource lastDs, IEReaderSender kindle, INotificationSender summarySender, int maxAantalArticles) { this.args = args; this.logger = logger; this.reader = reader; this.renderer = renderer; this.decorrespondent = decorrespondent; this.lastDs = lastDs; this.kindle = kindle; this.summarySender = summarySender; this.maxAantalArticles = maxAantalArticles; }
public void SendRawNotification(Guid subscriptionId, Guid notificationId, string rawContent, int attemptsLeft, INotificationSender notificationSender, IMessageScheduler messageScheduler) { Subscription subscription; if (!_subscriptions.TryGetValue(subscriptionId, out subscription)) { throw new UnknownSubscriptionException(Id, subscriptionId); } if (subscription.Kind != NotificationKind.Raw) { throw new InvalidOperationException("Trying to send Raw notification to Tile/Toast subscription."); } SendNotification(subscriptionId, new RawNotification(notificationId, rawContent), attemptsLeft, notificationSender, messageScheduler); }
public void SendToastNotification(Guid subscriptionId, Guid notificationId, string title, string body, int attemptsLeft, INotificationSender notificationSender, IMessageScheduler messageScheduler) { Subscription subscription; if (!_subscriptions.TryGetValue(subscriptionId, out subscription)) { throw new UnknownSubscriptionException(Id, subscriptionId); } if (subscription.Kind != NotificationKind.Toast) { throw new InvalidOperationException("Trying to send Toast notification to Tile/Raw subscription."); } SendNotification(subscriptionId, new ToastNotification(notificationId, title, body, subscription.ParamUri), attemptsLeft, notificationSender, messageScheduler); }
public void SendTileNotification(Guid subscriptionId, Guid notificationId, string title, int counter, string backBackgroundUri, string backTitle, string backgroundUri, string backContent, int attemptsLeft, INotificationSender notificationSender, IMessageScheduler messageScheduler) { Subscription subscription; if (!_subscriptions.TryGetValue(subscriptionId, out subscription)) { throw new UnknownSubscriptionException(Id, subscriptionId); } if (subscription.Kind != NotificationKind.Tile) { throw new InvalidOperationException("Trying to send Tile notification to Toast/Raw subscription."); } SendNotification(subscriptionId, new TileNotification(notificationId, title, counter, backBackgroundUri, backTitle, backgroundUri, backContent, subscription.ParamUri), attemptsLeft, notificationSender, messageScheduler); }
public AutoRegistrationPlugin(ISynchronizer synchronizer, IRegistrationRepository registrationRepository, IPageRepository pageRepository, IPageFormatter pageFormatter, IEntryFormatter entryFormatter, INotificationSender notificationSender, ILogger logger, IPluginConfiguration configuration, IFileReader fileReader, ISettings settings) { _synchronizer = synchronizer; _fileReader = fileReader; _settings = settings; _registrationRepository = registrationRepository; _pageRepository = pageRepository; _pageFormatter = pageFormatter; _entryFormatter = entryFormatter; _notificationSender = notificationSender; _logger = logger; _configuration = configuration; }
public InvitationController(IInvitationServiceLayer service, IWebSecurityWrapper security, INotificationSender notify) { _service = service; _security = security; _notify = notify; }
private void SendNotification(Guid subscriptionId, NotificationBase notification, int attemptsLeft, INotificationSender notificationSender, IMessageScheduler messageScheduler) { var response = notificationSender.SendNotification(_notificationChannel, notification); var toastNotification = notification as ToastNotification; var rawNotification = notification as RawNotification; var tileNotification = notification as TileNotification; if (response.HttpStatusCode == 200) { if (response.NotificationStatus == "Received") { if (toastNotification != null) PublishEvent(new ToastNotificationSucceededEvent(subscriptionId, toastNotification.NotificationId, attemptsLeft, toastNotification.Title, toastNotification.Body)); else if (rawNotification != null) PublishEvent(new RawNotificationSucceededEvent(subscriptionId, rawNotification.NotificationId, attemptsLeft, rawNotification.RawContent)); else if (tileNotification != null) PublishEvent(new TileNotificationSucceededEvent(subscriptionId, tileNotification.NotificationId, attemptsLeft, tileNotification.Title, tileNotification.BackgroundUri, tileNotification.Counter, tileNotification.BackTitle, tileNotification.BackContent, tileNotification.BackBackgroundUri)); return; } } // Something went wrong somehow. First, let's publish an event saing so. if (toastNotification != null) PublishEvent(new ToastNotificationFailedEvent(subscriptionId, toastNotification.NotificationId, attemptsLeft, DateTime.Now, response.HttpStatusCode, response.NotificationStatus, response.DeviceConnectionStatus, response.SubscriptionStatus, toastNotification.Title, toastNotification.Body)); else if (rawNotification != null) PublishEvent(new RawNotificationFailedEvent(subscriptionId, rawNotification.NotificationId, attemptsLeft, DateTime.Now, response.HttpStatusCode, response.NotificationStatus, response.DeviceConnectionStatus, response.SubscriptionStatus, rawNotification.RawContent)); else if (tileNotification != null) PublishEvent(new TileNotificationFailedEvent(subscriptionId, tileNotification.NotificationId, attemptsLeft, DateTime.Now, response.HttpStatusCode, response.NotificationStatus, response.DeviceConnectionStatus, response.SubscriptionStatus, tileNotification.Title, tileNotification.BackgroundUri, tileNotification.Counter, tileNotification.BackTitle, tileNotification.BackContent, tileNotification.BackBackgroundUri)); // Next let's figure out what to do next var resendTime = DateTime.Now; var shouldAttemptAgain = false; if (response.NotificationStatus == "QueueFull" || response.HttpStatusCode == 503) { // Service currently full or unavailable. resendTime = resendTime.AddMinutes(1); // TODO Increase exponentially shouldAttemptAgain = true; } else if (response.NotificationStatus == "Suppressed") { shouldAttemptAgain = false; } else if (response.NotificationStatus == "Dropped" && response.SubscriptionStatus == "Expired") { // Subscription Expired. Don't attempt again and unregister this client. shouldAttemptAgain = false; Unregister(); } else if (response.NotificationStatus == "Dropped" && response.SubscriptionStatus == "Active") { // Rate limit reached. Attempt to resend in one hour resendTime = resendTime.AddHours(1); shouldAttemptAgain = true; } else if (response.NotificationStatus == "Dropped" && response.DeviceConnectionStatus == "Inactive") { resendTime = resendTime.AddHours(1); shouldAttemptAgain = true; } // Should we re-try? if (shouldAttemptAgain) { attemptsLeft--; if (toastNotification != null) messageScheduler.ScheduleMessage(new SendToastNotificationCommand(this.Id, subscriptionId, toastNotification.NotificationId, toastNotification.Title, toastNotification.Body, attemptsLeft), resendTime); else if (rawNotification != null) messageScheduler.ScheduleMessage(new SendRawNotificationCommand(this.Id, subscriptionId, rawNotification.NotificationId, rawNotification.RawContent, attemptsLeft), resendTime); else if (tileNotification != null) messageScheduler.ScheduleMessage(new SendTileNotificationCommand(this.Id, subscriptionId, tileNotification.NotificationId, tileNotification.Title, tileNotification.Counter, tileNotification.BackgroundUri, tileNotification.BackTitle, tileNotification.BackContent, tileNotification.BackBackgroundUri, attemptsLeft), resendTime); } }
public ProgramWrapper(LogWrapper logger, WrappedResources resources, IArticleReader articleReader, IArticleRenderer articleRenderer, IDeCorrespondentResources reader, IEReaderSender sender, INotificationSender summarySender, DateTime? last) { this.logger = logger; wrappedResources = resources; LastDs = new MemoryLastDatasource(last); Program = new DeCorrespondent.Program(new DeCorrespondent.Program.ProgramArguments(true), logger, articleReader, articleRenderer, reader, LastDs, sender, summarySender, 20); }
public ContactRequestController(IContactServiceLayer service, IWebSecurityWrapper security, INotificationSender notice) { _service = service; _security = security; _notice = notice; }
public ProjectProfferController(IInvitationServiceLayer service, IWebSecurityWrapper security, INotificationSender notice) { _service = service; _security = security; _notice = notice; }
public void SetUp() { _sut = CreateSUT(); }
public DocumentController(IProjectDocServiceLayer service, IWebSecurityWrapper security, INotificationSender notice) { _service = service; _security = security; _notice = notice; }
public BidPackageInvitationsController(IInvitationServiceLayer service, IWebSecurityWrapper security, INotificationSender notice) { _service = service; _security = security; _notice = notice; }
public EdiFileProcessingService(IFileUtilities fileUtil, IAssignDocumentsToPartners assigner, INotificationSender notificationSender) { _fileUtil = fileUtil; _notificationSender = notificationSender; _assigner = assigner; }