public SettlementRepository(CleanArchitectureContext dbContext, ICommonRepository <TradePoolQueue> TradePoolQueue,
                             ICommonRepository <TradeBuyRequest> TradeBuyRequest, ICommonRepository <TradeBuyerList> TradeBuyerList,
                             ICommonRepository <TradeSellerList> TradeSellerList, ICommonRepository <TradePoolMaster> TradePoolMaster,
                             ICommonRepository <PoolOrder> PoolOrder, EFCommonRepository <TransactionQueue> TransactionRepository,
                             EFCommonRepository <TradeTransactionQueue> TradeTransactionRepository, IWalletService WalletService,
                             ISignalRService ISignalRService, IFrontTrnService IFrontTrnService, ICommonRepository <TradeStopLoss> TradeStopLoss, IMediator mediator, IMessageConfiguration messageConfiguration, UserManager <ApplicationUser> userManager)
 {
     _dbContext = dbContext;
     //_logger = logger;
     _TradePoolQueue             = TradePoolQueue;
     _TradeBuyRequest            = TradeBuyRequest;
     _TradeBuyerList             = TradeBuyerList;
     _TradeSellerList            = TradeSellerList;
     _TradePoolMaster            = TradePoolMaster;
     _PoolOrder                  = PoolOrder;
     _TransactionRepository      = TransactionRepository;
     _TradeTransactionRepository = TradeTransactionRepository;
     _WalletService              = WalletService;
     _ISignalRService            = ISignalRService;
     _IFrontTrnService           = IFrontTrnService;
     _TradeStopLoss              = TradeStopLoss;
     _mediator             = mediator;
     _messageConfiguration = messageConfiguration;
     _userManager          = userManager;
 }
 public ToDoItemsController(ILogger <ToDoItemsController> loggerFactory, IRepository <ToDoItem> todoRepository, IMediator mediator, IMessageConfiguration messageConfiguration)
 {
     _loggerFactory        = loggerFactory /*.CreateLogger<ToDoItemsController>()*/;
     _todoRepository       = todoRepository;
     _mediator             = mediator;
     _messageConfiguration = messageConfiguration;
 }
        public static TransportExtensions <SqlServerTransport> ConfigureNServiceBusDefaultTransport(
            this EndpointConfiguration endpointConfiguration, IMessageConfiguration messageConfiguration)
        {
            var config = messageConfiguration.Configure.Services.BuildServiceProvider().GetService <NServiceBusConfig>();

            var transport = endpointConfiguration.UseTransport <SqlServerTransport>();

            // Default Peek Delay
            transport.WithPeekDelay(config.TransportPeekDelay);

            // Schemas
            transport.UseSchemaForQueue(config.AuditQueue, "dbo");
            transport.UseSchemaForQueue(config.ErrorQueue, "dbo");
            transport.UseCatalogForEndpoint(config.EndpointName, config.EndpointDatabaseSchema);

            if (!string.IsNullOrEmpty(config.TransportConnectionString))
            {
                transport.ConnectionString(config.TransportConnectionString);
            }

            if (config.TransportTransactionMode.HasValue)
            {
                transport.Transactions(config.TransportTransactionMode.Value);
            }

            return(transport);
        }
Пример #4
0
        public ExecutionResult Process(object message, Type messageType)
        {
            var totalResult = new ExecutionResult();
            IMessageConfiguration messageConfiguration = _configuration.GetMessageConfiguration(messageType);

            IEnumerable <ICommandConfiguration> commandConfigurations = messageConfiguration.GetApplicableCommands(message);

            foreach (ICommandConfiguration commandConfiguration in commandConfigurations)
            {
                object commandMessage =
                    _mappingEngine.MapUiMessageToCommandMessage(message, messageType, commandConfiguration.CommandMessageType);

                commandConfiguration.Initialize(commandMessage, totalResult);

                ExecutionResult results = _commandInvoker.Process(commandMessage, commandConfiguration);
                totalResult.MergeWith(results);

                if (!totalResult.Successful)
                {
                    _unitOfWork.Invalidate();
                    break;
                }
            }

            return(totalResult);
        }
 public DSWAuthorizationServerProvider(IDataUnitOfWork dataUnitOfWork, ILogger logger, ITopicService topicService,
                                       IMessageConfiguration messageConfiguration)
 {
     _unitOfWork           = dataUnitOfWork;
     _logger               = logger;
     _topicService         = topicService;
     _messageConfiguration = messageConfiguration;
 }
Пример #6
0
 public BaseAuthenticateHub()
 {
     _topicService         = (ITopicService)UnityConfig.GetConfiguredContainer().GetService(typeof(ITopicService));
     _logger               = (ILogger)UnityConfig.GetConfiguredContainer().GetService(typeof(ILogger));
     _parameterEnvService  = (IParameterEnvService)UnityConfig.GetConfiguredContainer().GetService(typeof(IParameterEnvService));
     _messageConfiguration = (IMessageConfiguration)UnityConfig.GetConfiguredContainer().GetService(typeof(IMessageConfiguration));
     _messageMappings      = _messageConfiguration.GetConfigurations();
     _unitOfWork           = (IDataUnitOfWork)UnityConfig.GetConfiguredContainer().GetService(typeof(IDataUnitOfWork));
 }
Пример #7
0
 public KafkaConsumerWrapper(
     IMessageConfiguration messageConfiguration) : this()
 {
     this._messageConfiguration
         = messageConfiguration.IsValid()
         ? messageConfiguration
         : throw new ArgumentException(
                     "Invalid Message Configuration");
 }
 public EmailHandler(IMessageRepository <EmailQueue> MessageRepository, MessageConfiguration MessageConfiguration, MessageService MessageService, GetDataForParsingAPI GetDataForParsingAPI, WebApiParseResponse WebApiParseResponse, WebAPIParseResponseCls GenerateResponse)
 {
     _MessageRepository    = MessageRepository;
     _MessageConfiguration = MessageConfiguration;
     _MessageService       = MessageService;
     _GetDataForParsingAPI = GetDataForParsingAPI;
     _WebApiParseResponse  = WebApiParseResponse;
     _GenerateResponse     = GenerateResponse;
 }
        public MessageManagementPresenter()
        {
            view = new MessageManagementView(this);

            queueManager = new QueueManager();

            messageConfiguration = new MessageConfiguration();

            serializer = messageConfiguration.GetSerializer();
        }
Пример #10
0
 public MessagePublisher(
     IMessageConfiguration configuration,
     IMessagePublisherWrapper publisherWrapper)
 {
     this._configuration = configuration
                           ?? throw new ArgumentNullException(
                                     nameof(configuration));
     this._publisherWrapper = publisherWrapper
                              ?? throw new ArgumentNullException(
                                        nameof(publisherWrapper));
 }
Пример #11
0
 public MessageBroker(
     IMessageConfiguration configuration)
     : this()
 {
     if (!configuration.IsValid())
     {
         throw new ArgumentException($"nameof(configuration) is not valid!");
     }
     this._configuration = configuration;
     Logger = NullMessageBrokerLogger.Default;
 }
 public TokenSecuritiesController(ILogger logger, ITopicService topicService, IParameterEnvService parameterEnvService,
                                  IDataUnitOfWork unitOfWork, ICQRSMessageMapper cqrsMapper, IMessageConfiguration messageConfiguration)
     : base()
 {
     _logger               = logger;
     _topicService         = topicService;
     _parameterEnvService  = parameterEnvService;
     _instanceId           = Guid.NewGuid();
     _unitOfWork           = unitOfWork;
     _cqrsMapper           = cqrsMapper;
     _messageConfiguration = messageConfiguration;
 }
Пример #13
0
        public void ConfigureOAuth(IAppBuilder app, IDataUnitOfWork dataUnitOfWork, ILogger logger, ITopicService topicService,
                                   IMessageConfiguration messageConfiguration)
        {
            OAuthAuthorizationServerOptions oAuthServerOptions = new OAuthAuthorizationServerOptions()
            {
                AllowInsecureHttp         = true,
                TokenEndpointPath         = new PathString("/Auth/Token"),
                AccessTokenExpireTimeSpan = TimeSpan.FromHours(8),
                Provider = new DSWAuthorizationServerProvider(dataUnitOfWork, logger, topicService, messageConfiguration)
            };

            app.UseOAuthAuthorizationServer(oAuthServerOptions);
            app.UseOAuthBearerAuthentication(new OAuthBearerAuthenticationOptions());
        }
Пример #14
0
 public OtpMasterService(
     CleanArchitectureContext dbContext, IUserService userService,
     //ICustomRepository<OtpMaster> customRepository,
     IMessageRepository <OtpMaster> customRepository,
     IRegisterTypeService registerTypeService, IMediator mediator, IMessageConfiguration messageConfiguration)
 {
     _dbContext        = dbContext;
     _userService      = userService;
     _customRepository = customRepository;
     //_customRepository = customRepository;
     _registerTypeService  = registerTypeService;
     _mediator             = mediator;
     _messageConfiguration = messageConfiguration;
 }
Пример #15
0
        public void Configuration(IAppBuilder appBuilder)
        {
            HttpConfiguration     config               = new HttpConfiguration();
            IDependencyResolver   resolver             = UnityConfig.GetConfiguredContainer();
            IDataUnitOfWork       dataUnitOfWork       = resolver.GetService(typeof(IDataUnitOfWork)) as IDataUnitOfWork;
            ILogger               logger               = resolver.GetService(typeof(ILogger)) as ILogger;
            ITopicService         topicService         = resolver.GetService(typeof(ITopicService)) as ITopicService;
            IMessageConfiguration messageConfiguration = resolver.GetService(typeof(IMessageConfiguration)) as IMessageConfiguration;

            config.DependencyResolver = resolver;

            ConfigureOAuth(appBuilder, dataUnitOfWork, logger, topicService, messageConfiguration);
            WebApiConfig.Register(config);
            appBuilder.UseCors(Microsoft.Owin.Cors.CorsOptions.AllowAll);
            appBuilder.UseWebApi(config);
        }
Пример #16
0
        public TopicService(IServiceBusConfiguration configuration, ILogger logger,
                            IServiceBusMessageMapper mapper_to_brokered, IBrokeredMessageMapper mapper_to_message,
                            IServiceBusTopicContext topicContext, IMessageConfiguration messageConfiguration)
        {
            if (configuration == null || string.IsNullOrEmpty(configuration.ConnectionString))
            {
                throw new DSWException(SERVICE_BASE_CONNECTIONSTRING_IS_EMPTY, null, DSWExceptionCode.SS_Mapper);
            }

            _instanceId           = Guid.NewGuid();
            _configuration        = configuration;
            _messageConfiguration = messageConfiguration.GetConfigurations();
            _logger             = logger;
            _mapper_to_brokered = mapper_to_brokered;
            _mapper_to_message  = mapper_to_message;
            _topicContext       = topicContext;
        }
Пример #17
0
        /// <inheritdoc />
        public object DecorateConsumer(object consumer, Type messageType, IMessageConfiguration messageConfig, string endpointName)
        {
            var cachingConsumerType = typeof(CachingConsumerOf <>).MakeGenericType(messageType);
            var cacheConfig         = this.cacheConfigProvider.GetIncomingCacheConfig(endpointName);

            var consumerCacheConfig = cacheConfig[messageConfig.Label];

            try
            {
                var cachingConsumer = Activator.CreateInstance(cachingConsumerType, consumer, consumerCacheConfig);
                return(cachingConsumer);
            }
            catch (Exception e)
            {
                Log.Error(m => m("Could not create caching decorator of '{0}' consumer", messageConfig.Label), e);
                throw;
            }
        }
Пример #18
0
 public WorkflowStartService(ILogger logger, IWorkflowInstanceService workflowInstanceService, IWorkflowArgumentMapper workflowArgumentMapper,
                             IWorkflowInstanceRoleService workflowInstanceRoleService, IWorkflowActivityService workflowActivityService,
                             ITopicService topicServiceBus, ICQRSMessageMapper mapper_eventServiceBusMessage,
                             IDataUnitOfWork unitOfWork, StorageDocument.IDocumentContext <ModelDocument.Document, ModelDocument.ArchiveDocument> documentService,
                             ICollaborationService collaborationService, ISecurity security, IParameterEnvService parameterEnvService, IFascicleRoleService fascicleRoleService,
                             IMessageService messageService, IDossierRoleService dossierRoleService, IQueueService queueService, IWordOpenXmlDocumentGenerator wordOpenXmlDocumentGenerator,
                             IMessageConfiguration messageConfiguration, IProtocolLogService protocolLogService, IPDFDocumentGenerator pdfDocumentGenerator,
                             IFascicleService fascicleService, IFascicleDocumentService fascicleDocumentService, IFascicleFolderService fascicleFolderService,
                             IFascicleDocumentUnitService fascDocumentUnitService, IFascicleLinkService fascicleLinkService)
     : base(logger, workflowInstanceService, workflowInstanceRoleService, workflowActivityService, topicServiceBus, mapper_eventServiceBusMessage,
            unitOfWork, documentService, collaborationService, security, parameterEnvService, fascicleRoleService, messageService, dossierRoleService, queueService,
            wordOpenXmlDocumentGenerator, messageConfiguration, protocolLogService, pdfDocumentGenerator, fascicleService, fascicleDocumentService, fascicleFolderService,
            fascDocumentUnitService, fascicleLinkService)
 {
     _unitOfWork = unitOfWork;
     _workflowInstanceService = workflowInstanceService;
     _workflowArgumentMapper  = workflowArgumentMapper;
     _documentService         = documentService;
 }
Пример #19
0
        /// <summary>
        /// 验证消息配置是否可用
        /// </summary>
        /// <param name="configuration"></param>
        /// <returns></returns>
        public static bool IsValid(
            this IMessageConfiguration configuration)
        {
            if (configuration == null)
            {
                return(false);
            }
            if (string.IsNullOrWhiteSpace(configuration.BrokerAddress))
            {
                return(false);
            }

            if (configuration.BrokerPort <= 0)
            {
                return(false);
            }
            if (!Uri.TryCreate($"tcp://{ configuration.BrokerAddress}:{ configuration.BrokerPort}",
                               UriKind.Absolute, out var xsubAddr))
            {
                return(false);
            }
            return(true);
        }
Пример #20
0
 public RabbitMqListener(IMessageConfiguration busConfiguration)
 {
     _busConfiguration = busConfiguration;
 }
Пример #21
0
 /// <inheritdoc />
 public object DecorateConsumer(object consumer, Type messageType, IMessageConfiguration messageConfig, string endpointName) => consumer;
        public static void ConfigureNServiceBusDefaultPersistence(this EndpointConfiguration endpointConfiguration, IMessageConfiguration configuration)
        {
            var config = configuration.Configure.Services.BuildServiceProvider().GetService <NServiceBusConfig>();

            var nhConfiguration = new NHibernate.Cfg.Configuration
            {
                Properties =
                {
                    ["dialect"]                      = "NHibernate.Dialect.MsSql2012Dialect",
                    ["connection.provider"]          = "NHibernate.Connection.DriverConnectionProvider",
                    ["connection.driver_class"]      = "NHibernate.SqlAzure.SqlAzureClientDriver, NHibernate.SqlAzure",
                    ["default_schema"]               = config.EndpointDatabaseSchema,
                    ["connection.connection_string"] = config.PersistenceConnectionString
                }
            };

            var persistence = endpointConfiguration.UsePersistence <NHibernatePersistence>();

            persistence.UseConfiguration(nhConfiguration);
        }
Пример #23
0
 public SMSHandler(IMessageRepository <MessagingQueue> MessageRepository, MessageConfiguration MessageConfiguration, MessageService MessageService)
 {
     _MessageRepository    = MessageRepository;
     _MessageConfiguration = MessageConfiguration;
     _MessageService       = MessageService;
 }
Пример #24
0
 public void registerMessageClasses(IMessageConfiguration arg1)
 {
     throw new NotImplementedException();
 }
Пример #25
0
 public CQRSMessageMapper(IMessageConfiguration messageConfiguration)
 {
     _configurations = messageConfiguration.GetConfigurations();
 }
Пример #26
0
 public MessageService(IMessageRepository repository, IIdentityService identityService, IMessageConfiguration configuration)
 {
     this.Repository      = repository;
     this.IdentityService = identityService;
     this.Configuration   = configuration;
 }
Пример #27
0
 public EmailMessage(ILogger <IMessage> logger, IMessageConfiguration config)
 {
     this.logger = logger;
     this.config = config;
 }
Пример #28
0
 public EmailMessage(ILogger <IMessage> logger, IMessageConfiguration config)
 {
     _logger = logger;
     _config = config;
 }