Пример #1
0
 public MessageService(IMessageStore messageStore, IOffsetManager offsetManager, IScheduleService scheduleService)
 {
     _messageStore = messageStore;
     _offsetManager = offsetManager;
     _scheduleService = scheduleService;
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
 }
Пример #2
0
 public MessageService(IQueueService queueService, IMessageStore messageStore, IOffsetManager offsetManager)
 {
     _queueService = queueService;
     _messageStore = messageStore;
     _offsetManager = offsetManager;
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
 }
Пример #3
0
 public SendMessageRequestHandler()
 {
     _suspendedPullRequestManager = ObjectContainer.Resolve<SuspendedPullRequestManager>();
     _messageStore = ObjectContainer.Resolve<IMessageStore>();
     _queueService = ObjectContainer.Resolve<IQueueStore>();
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
 }
Пример #4
0
        public ChatHub(string botName, IMessageStore messageStore, IUserStore userStore, IEnumerable<ICommandProcessor> commandProcessors, IEnumerable<IContentProvider> contentProviders)
        {
            if (string.IsNullOrWhiteSpace(botName))
            {
                throw new ArgumentNullException("botName");
            }

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

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

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

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

            ChatHubConfiguration.BotName = botName;
            MessageStore = messageStore;
            UserStore = userStore;
            CommandProcessors = commandProcessors;
            CommandProcessorDescriptions = CommandProcessors.Select(p => new CommandDescription() { Description = p.Description, Name = p.Name, Usage = p.Usage }).OrderBy(d => d.Name) as IEnumerable<CommandDescription>;
            ContentProviders = contentProviders;
            ContentProviderDescriptions = ContentProviders.Select(p => new ContentProviderDescription() { Description = p.Description, Name = p.Name, }).OrderBy(d => d.Name) as IEnumerable<ContentProviderDescription>;
        }
Пример #5
0
        public Smtp4devEngine(ISettingsStore settingsStore, IMessageStore messageStore)
        {
            _settingsStore = settingsStore;
            _settingsStore.Saved += OnSettingsChanged;
            _messageStore = messageStore;

            TryStart();
        }
Пример #6
0
        /// <summary>
        ///   Initializes a new instance of the <see cref = "StompQueue" /> class.
        /// </summary>
        /// <param name = "address">The address.</param>
        /// <param name = "store">The message store.</param>
        public StompQueue(string address, IMessageStore store)
        {
            if (address == null) throw new ArgumentNullException("address");
            if (!address.StartsWith("/")) address = string.Format("/{0}", address);

            Address = address;
            Store = store;
        }
Пример #7
0
 protected PersistentConnection(Signaler signaler,
                                IMessageStore store,
                                IJsonStringifier jsonStringifier)
 {
     _signaler = signaler;
     _store = store;
     _jsonStringifier = jsonStringifier;
 }
Пример #8
0
 public DefaultQueueStore(IMessageStore messageStore, IConsumeOffsetStore consumeOffsetStore, IScheduleService scheduleService, ILoggerFactory loggerFactory)
 {
     _queueDict = new ConcurrentDictionary<string, Queue>();
     _messageStore = messageStore;
     _consumeOffsetStore = consumeOffsetStore;
     _scheduleService = scheduleService;
     _logger = loggerFactory.Create(GetType().FullName);
 }
Пример #9
0
 public QueueService(IQueueStore queueStore, IMessageStore messageStore, IOffsetManager offsetManager, IScheduleService scheduleService, ILoggerFactory loggerFactory)
 {
     _queueDict = new ConcurrentDictionary<string, Queue>();
     _queueStore = queueStore;
     _messageStore = messageStore;
     _offsetManager = offsetManager;
     _scheduleService = scheduleService;
     _logger = loggerFactory.Create(GetType().FullName);
 }
Пример #10
0
 public PullMessageRequestHandler()
 {
     _consumerManager = ObjectContainer.Resolve<ConsumerManager>();
     _suspendedPullRequestManager = ObjectContainer.Resolve<SuspendedPullRequestManager>();
     _messageStore = ObjectContainer.Resolve<IMessageStore>();
     _queueStore = ObjectContainer.Resolve<IQueueStore>();
     _offsetStore = ObjectContainer.Resolve<IConsumeOffsetStore>();
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
 }
 public FileMessageStoreTransaction(IMessageStore messageStore, DirectoryInfo rootDirectory, DirectoryInfo dataDirectory, DirectoryInfo metaDirectory)
 {
     _messageStore = messageStore;
       _rootDirectory = rootDirectory;
       _dataDirectory = dataDirectory;
       _metaDirectory = metaDirectory;
       TransactionId = Guid.NewGuid();
       _enlistedForRemoval = new List<SimpleQueueMessage>();
 }
 public DefaultChunkReadStatisticService(IMessageStore messageStore, IScheduleService scheduleService, ILoggerFactory loggerFactory)
 {
     _messageStore = messageStore;
     _scheduleService = scheduleService;
     _logger = loggerFactory.Create("ChunkRead");
     _fileReadDict = new ConcurrentDictionary<int, CountInfo>();
     _unmanagedReadDict = new ConcurrentDictionary<int, CountInfo>();
     _cachedReadDict = new ConcurrentDictionary<int, CountInfo>();
 }
Пример #13
0
 protected PersistentConnection(Signaler signaler,
                                IClientIdFactory clientIdFactory,
                                IMessageStore store,
                                IJsonSerializer jsonSerializer)
 {
     _signaler = signaler;
     _clientIdFactory = clientIdFactory;
     _store = store;
     _jsonSerializer = jsonSerializer;
 }
Пример #14
0
        public void createNotificationForTask(int TaskId, string cfgSQLConnectionString)
        {
            this.cfgSQLConnectionString = cfgSQLConnectionString;
            configStore = StoreHandler.getConfigStore(cfgSQLConnectionString);
            baseURL = configStore.getString(BaseURL);
            templatepath = configStore.getString(Email_NotificationTemplate);

            taskStore = StoreHandler.getTaskStore(cfgSQLConnectionString);
            T_Task task = taskStore.getTaskById(TaskId);
            helper = new MailBodyHelper();
            processStore = StoreHandler.getProcessStore(cfgSQLConnectionString);
            instance = processStore.getWorkflowInstance(task.WFId);
            mail = new SmtpUtils(configStore);
            if (task.Type.Equals("F") || task.Type.Equals("S"))
            {
                if (configStore.getBool(Email_Notifications_Tasks))
                {
                    string content = helper.getStateBody(task, baseURL, templatepath);



                    List<string> recipients = new List<string>();

                    if (String.IsNullOrEmpty(instance.Owner))
                    {
                        var subject = processStore.getProcessSubjectForWFId(task.WFId);
                        userStore = StoreHandler.getUserStore(cfgSQLConnectionString);
                        recipients.AddRange(userStore.getUsernamesForRole(subject.U_Role_Id));
                    }
                    else
                    {
                        recipients.Add(instance.Owner);
                    }

                    foreach (string user in recipients)
                    {
                        mail.sendMail(user, "InFlow: " + task.Name + " #" + task.Id, content);
                    }
                }
            }
            if (task.Type.Equals("R"))
            {
                if (configStore.getBool(Email_Notifications_Messages))
                {
                    messageStore = StoreHandler.getMessageStore(cfgSQLConnectionString);
                    var messages = messageStore.getMessagesForReceiveStateTask(task.WFId, task.getTaskPropertiesAsListOfString());

                    foreach (var i in messages)
                    {
                        createReceiveNotification(i, task);
                    }
                }
            }

        }
        public InnerSimpleQueue(BlockingCollection<SimpleQueueMessage> queue, string directoryPath)
        {
            if (queue == null) throw new ArgumentNullException("queue");
              Queue = queue;
              DirectoryPath = directoryPath;

              _messageStore = new FileMessageStore(DirectoryPath);
              _directory = new DirectoryInfo(DirectoryPath);

              MakeSureQueueExsists();
        }
Пример #16
0
 protected PersistentConnection(Signaler signaler,
                                IConnectionIdFactory connectionIdFactory,
                                IMessageStore store,
                                IJsonSerializer jsonSerializer,
                                ITransportManager transportManager)
 {
     _signaler = signaler;
     _connectionIdFactory = connectionIdFactory;
     _store = store;
     _jsonSerializer = jsonSerializer;
     _transportManager = transportManager;
 }
Пример #17
0
 public SendMessageRequestHandler(BrokerController brokerController)
 {
     _brokerController = brokerController;
     _suspendedPullRequestManager = ObjectContainer.Resolve<SuspendedPullRequestManager>();
     _messageStore = ObjectContainer.Resolve<IMessageStore>();
     _queueStore = ObjectContainer.Resolve<IQueueStore>();
     _tpsStatisticService = ObjectContainer.Resolve<ITpsStatisticService>();
     _notifyWhenMessageArrived = _brokerController.Setting.NotifyWhenMessageArrived;
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
     _sendRTLogger = ObjectContainer.Resolve<ILoggerFactory>().Create("SendRT");
     var messageWriteQueueThreshold = brokerController.Setting.MessageWriteQueueThreshold;
     _bufferQueue = new BufferQueue<StoreContext>("QueueBufferQueue", messageWriteQueueThreshold, OnQueueMessageCompleted, _logger);
 }
        public void AddMessageStore(IMessageStore store, string key)
        {
            if (String.IsNullOrEmpty(key))
            {
                throw new ArgumentNullException("key");
            }

            if (MessageStores == null)
            {
                MessageStores = new Dictionary<string, IMessageStore>();
            }
            MessageStores.Add(key, store);
        }
Пример #19
0
 private BrokerController(BrokerSetting setting)
 {
     Setting = setting ?? new BrokerSetting();
     _consumerManager = ObjectContainer.Resolve<ConsumerManager>();
     _messageStore = ObjectContainer.Resolve<IMessageStore>();
     _offsetManager = ObjectContainer.Resolve<IOffsetManager>();
     _queueService = ObjectContainer.Resolve<IQueueService>();
     _messageService = ObjectContainer.Resolve<IMessageService>();
     _suspendedPullRequestManager = ObjectContainer.Resolve<SuspendedPullRequestManager>();
     _producerSocketRemotingServer = new SocketRemotingServer("EQueue.Broker.ProducerRemotingServer", Setting.ProducerIPEndPoint);
     _consumerSocketRemotingServer = new SocketRemotingServer("EQueue.Broker.ConsumerRemotingServer", Setting.ConsumerIPEndPoint, this);
     _adminSocketRemotingServer = new SocketRemotingServer("EQueue.Broker.AdminRemotingServer", Setting.AdminIPEndPoint);
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
     RegisterRequestHandlers();
 }
Пример #20
0
        public DriverCatalog(IMessageStore messageStore, IMessageChannel messageChannel)
        {
            this.MessageStores = new List<IMessageStore>();
            this.MessageChannels = new List<IMessageChannel>();

            if (messageStore != null)
            {
                this.MessageStores.Add(messageStore);
            }
            if (messageChannel != null)
            {
                this.MessageChannels.Add(messageChannel);
            }
            InitializeComposition();
        }
Пример #21
0
 public HubDispatcher(IHubFactory hubFactory,
                      IMessageStore store,
                      Signaler signaler,
                      IActionResolver actionResolver,
                      IJavaScriptProxyGenerator proxyGenerator,
                      IJsonStringifier jsonStringifier,
                      string url)
     : base(signaler, store, jsonStringifier)
 {
     _hubFactory = hubFactory;
     _store = store;
     _signaler = signaler;
     _actionResolver = actionResolver;
     _proxyGenerator = proxyGenerator;
     _url = VirtualPathUtility.ToAbsolute(url);
 }
Пример #22
0
 public AuthorizeEndpoint(
     IEventService events, 
     ILogger<AuthorizeEndpoint> logger,
     IdentityServerContext context,
     IAuthorizeRequestValidator validator,
     IAuthorizeInteractionResponseGenerator interactionGenerator,
     IAuthorizeEndpointResultFactory resultGenerator,
     IMessageStore<SignInResponse> signInResponseStore,
     IMessageStore<ConsentResponse> consentRequestStore)
 {
     _events = events;
     _logger = logger;
     _context = context;
     _validator = validator;
     _interactionGenerator = interactionGenerator;
     _resultGenerator = resultGenerator;
     _signInResponseStore = signInResponseStore;
     _consentResponseStore = consentRequestStore;
 }
 public AuthorizeEndpointResultFactory(
     ILogger<AuthorizeEndpointResultFactory> logger,
     IdentityServerContext context,
     IAuthorizeResponseGenerator responseGenerator,
     ILocalizationService localizationService,
     IMessageStore<SignInRequest> signInRequestStore,
     IMessageStore<ConsentRequest> consentRequestStore,
     IMessageStore<ErrorMessage> errorMessageStore,
     ClientListCookie clientListCookie)
 {
     _logger = logger;
     _context = context;
     _responseGenerator = responseGenerator;
     _localizationService = localizationService;
     _signInRequestStore = signInRequestStore;
     _consentRequestStore = consentRequestStore;
     _errorMessageStore = errorMessageStore;
     _clientListCookie = clientListCookie;
 }
Пример #24
0
        private void initService()
        {
            if (connectionString == null)
            {
                connectionString = ConfigurationSettings.AppSettings["repositoryConnectionString"].ToString();

                wfmBaseAddress = ConfigurationSettings.AppSettings["wfmBaseAddress"].ToString();
                wfmUsername = ConfigurationSettings.AppSettings["wfmUsername"].ToString();

                wfmPassword = ConfigurationSettings.AppSettings["wfmPassword"].ToString();

                taskStore = StoreHandler.getTaskStore(connectionString);
                processStore = StoreHandler.getProcessStore(connectionString);
                userStore = StoreHandler.getUserStore(connectionString);
                messageStore = StoreHandler.getMessageStore(connectionString);

                _db = new InFlowDb();
            }
        }
Пример #25
0
        static void InitializeEQueue()
        {
            var configuration = ECommonConfiguration
                .Create()
                .UseAutofac()
                .RegisterCommonComponents()
                .UseLog4Net()
                .UseJsonNet()
                .RegisterUnhandledExceptionHandler()
                .RegisterEQueueComponents();

            BrokerController.Create(new BrokerSetting(ConfigurationManager.AppSettings["fileStoreRootPath"], 1024 * 1024 * 1024, enableCache: false));

            _messageStore = ObjectContainer.Resolve<IMessageStore>();
            _scheduleService = ObjectContainer.Resolve<IScheduleService>();
            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(typeof(Program).Name);

            _messageStore.Load();
            _messageStore.Start();
        }
Пример #26
0
        private BrokerController(BrokerSetting setting)
        {
            Setting = setting ?? new BrokerSetting();
            _consumerManager = ObjectContainer.Resolve<ConsumerManager>();
            _messageStore = ObjectContainer.Resolve<IMessageStore>();
            _consumeOffsetStore = ObjectContainer.Resolve<IConsumeOffsetStore>();
            _queueStore = ObjectContainer.Resolve<IQueueStore>();
            _suspendedPullRequestManager = ObjectContainer.Resolve<SuspendedPullRequestManager>();
            _chunkReadStatisticService = ObjectContainer.Resolve<IChunkStatisticService>();

            _producerSocketRemotingServer = new SocketRemotingServer("EQueue.Broker.ProducerRemotingServer", Setting.ProducerAddress, Setting.SocketSetting);
            _consumerSocketRemotingServer = new SocketRemotingServer("EQueue.Broker.ConsumerRemotingServer", Setting.ConsumerAddress, Setting.SocketSetting);
            _adminSocketRemotingServer = new SocketRemotingServer("EQueue.Broker.AdminRemotingServer", Setting.AdminAddress, Setting.SocketSetting);

            _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
            _consumerSocketRemotingServer.RegisterConnectionEventListener(new ConsumerConnectionEventListener(this));
            RegisterRequestHandlers();

            _service = new ConsoleEventHandlerService();
            _service.RegisterClosingEventHandler(eventCode => { Shutdown(); });
        }
Пример #27
0
        public MessageQueue(string id, IMessageStore store, IMessageChannel channel)
        {
            if (string.IsNullOrWhiteSpace(id))
            {
                throw new ArgumentException("id");
            }

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

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

            this.Id = id;
            this.store = store;
            this.channel = channel;
        }
Пример #28
0
 public HubDispatcher(IHubFactory hubFactory,
                      IMessageStore store,
                      Signaler signaler,
                      IConnectionIdFactory connectionIdFactory,
                      IActionResolver actionResolver,
                      IJavaScriptProxyGenerator proxyGenerator,
                      IJsonSerializer jsonSerializer,
                      IHubLocator hubLocator,
                      IHubTypeResolver hubTypeResolver,
                      string url)
     : base(signaler, connectionIdFactory, store, jsonSerializer)
 {
     _hubFactory = hubFactory;
     _store = store;
     _jsonSerializer = jsonSerializer;
     _signaler = signaler;
     _actionResolver = actionResolver;
     _proxyGenerator = proxyGenerator;
     _hubLocator = hubLocator;
     _hubTypeResolver = hubTypeResolver;
     _url = VirtualPathUtility.ToAbsolute(url);
 }
Пример #29
0
        private void InitializeMessageStore()
        {
            if (catalog != null && catalog.MessageStores != null)
            {
                // Try and find a message store that isn't the InMemoryMessageStore.
                var stores = catalog.MessageStores.Where(x => x.GetType() != typeof(InMemoryMessageStore));

                if (stores.Count() == 1)
                {
                    // If only one message store is present, use it.
                    this.MessageStore = stores.FirstOrDefault();
                }
                else
                {
            #if DEBUG
                    // No message store found. Let's default to the InMemoryMessageStore.
                    this.MessageStore = catalog.MessageStores.Where(x => x.GetType() == typeof(InMemoryMessageStore)).FirstOrDefault();
            #endif
                }
            }
            if (this.MessageStore == null)
            {
                throw new ApplicationException("Unable to load message storage driver");
            }
        }
Пример #30
0
 public MessageManager(Log log, IMessageStore messageStore)
 {
     this.log = log;
     this.store = messageStore;
     this.log.SetCategory("Message");
 }