public LightweightExternalOrderbookService( IEventChannel <BestPriceChangeEventArgs> bestPriceChangeEventChannel, IOrderBookProviderApi orderBookProviderApi, IDateService dateService, IConvertService convertService, IScheduleSettingsCacheService scheduleSettingsCache, IAssetPairDayOffService assetPairDayOffService, IAssetPairsCache assetPairsCache, ICqrsSender cqrsSender, IIdentityGenerator identityGenerator, ILog log, MarginTradingSettings marginTradingSettings) { _bestPriceChangeEventChannel = bestPriceChangeEventChannel; _orderBookProviderApi = orderBookProviderApi; _dateService = dateService; _convertService = convertService; _scheduleSettingsCache = scheduleSettingsCache; _assetPairDayOffService = assetPairDayOffService; _assetPairsCache = assetPairsCache; _cqrsSender = cqrsSender; _identityGenerator = identityGenerator; _log = log; _defaultExternalExchangeId = string.IsNullOrEmpty(marginTradingSettings.DefaultExternalExchangeId) ? "Default" : marginTradingSettings.DefaultExternalExchangeId; _orderbookValidation = marginTradingSettings.OrderbookValidation; }
public ValidateOrderService( IQuoteCacheService quoteCashService, IAccountUpdateService accountUpdateService, IAccountsCacheService accountsCacheService, ITradingInstrumentsCacheService accountAssetsCacheService, IAssetPairsCache assetPairsCache, OrdersCache ordersCache, IAssetPairDayOffService assetDayOffService, IIdentityGenerator identityGenerator, IDateService dateService, MarginTradingSettings marginSettings, ICfdCalculatorService cfdCalculatorService) { _quoteCashService = quoteCashService; _accountUpdateService = accountUpdateService; _accountsCacheService = accountsCacheService; _tradingInstrumentsCache = accountAssetsCacheService; _assetPairsCache = assetPairsCache; _ordersCache = ordersCache; _assetDayOffService = assetDayOffService; _identityGenerator = identityGenerator; _dateService = dateService; _marginSettings = marginSettings; _cfdCalculatorService = cfdCalculatorService; }
public MtController( IMarginTradingAccountHistoryRepository accountsHistoryRepository, IMarginTradingOrdersHistoryRepository ordersHistoryRepository, IMicrographCacheService micrographCacheService, IAccountAssetsCacheService accountAssetsCacheService, IAssetPairsCache assetPairsCache, IMarketMakerMatchingEngine matchingEngine, ITradingEngine tradingEngine, IAccountsCacheService accountsCacheService, IMarginTradingOperationsLogService operationsLogService, IConsole consoleWriter, OrdersCache ordersCache, MarginSettings marginSettings, AccountManager accountManager, IAssetPairDayOffService assetDayOffService, IQuoteCacheService quoteCacheService, IIdentityGenerator identityGenerator) { _accountsHistoryRepository = accountsHistoryRepository; _ordersHistoryRepository = ordersHistoryRepository; _micrographCacheService = micrographCacheService; _accountAssetsCacheService = accountAssetsCacheService; _assetPairsCache = assetPairsCache; _matchingEngine = matchingEngine; _tradingEngine = tradingEngine; _accountsCacheService = accountsCacheService; _operationsLogService = operationsLogService; _consoleWriter = consoleWriter; _ordersCache = ordersCache; _marginSettings = marginSettings; _accountManager = accountManager; _assetDayOffService = assetDayOffService; _quoteCacheService = quoteCacheService; _identityGenerator = identityGenerator; }
public PositionsConsumer(OrdersCache ordersCache, IRabbitMqNotifyService rabbitMqNotifyService, IConvertService convertService, IDateService dateService, IAccountsCacheService accountsCacheService, IAccountUpdateService accountUpdateService, IIdentityGenerator identityGenerator, ICqrsSender cqrsSender, IEventChannel <OrderCancelledEventArgs> orderCancelledEventChannel, IEventChannel <OrderChangedEventArgs> orderChangedEventChannel, IEventChannel <OrderActivatedEventArgs> orderActivatedEventChannel, IMatchingEngineRouter meRouter, ILog log) { _ordersCache = ordersCache; _rabbitMqNotifyService = rabbitMqNotifyService; _convertService = convertService; _dateService = dateService; _accountsCacheService = accountsCacheService; _accountUpdateService = accountUpdateService; _identityGenerator = identityGenerator; _cqrsSender = cqrsSender; _orderCancelledEventChannel = orderCancelledEventChannel; _orderChangedEventChannel = orderChangedEventChannel; _orderActivatedEventChannel = orderActivatedEventChannel; _meRouter = meRouter; _log = log; }
public PoolManager(IIdentityGenerator identityGenerator, IEventSystem eventSystem) { IdentityGenerator = identityGenerator; EventSystem = eventSystem; pools = new Dictionary <string, IPool>(); CreatePool(DefaultPoolName); }
/// <summary> /// Initializes a new instance of the <see cref="IdentityGeneratingEntityData"/> class. /// </summary> /// <param name="query">Query.</param> /// <param name="persister">Persister.</param> /// <param name="identityGenerator">Identity generator.</param> public IdentityGeneratingEntityData(IQuery query, IPersister persister, IIdentityGenerator identityGenerator) : base(query, persister) { this.identityGenerator = identityGenerator ?? new InMemoryIdentityGenerator(); }
public Pool(string name, IIdentityGenerator identityGenerator, IEventSystem eventSystem) { _entities = new List <IEntity>(); Name = name; IdentityGenerator = identityGenerator; EventSystem = eventSystem; }
private IdentityGenerator() { if (AppRuntime.Instance.CurrentApplication == null) { throw new EagleAppException("The application has not been initialized and started yet."); } if (AppRuntime.Instance.CurrentApplication.ConfigSource == null || AppRuntime.Instance.CurrentApplication.ConfigSource.Config == null || AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators == null || AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators.IdentityGenerator == null || string.IsNullOrEmpty(AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators.IdentityGenerator.Provider)) { generator = new SequentialIdentityGenerator(); } else { Type type = Type.GetType(AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators.IdentityGenerator.Provider); if (type == null) { throw new ConfigException("Unable to create the type from the name {0}.", AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators.IdentityGenerator.Provider); } if (type.Equals(this.GetType())) { throw new EagleAppException("Type {0} cannot be used as identity generator, it is maintained by the Eagle framework internally.", this.GetType().AssemblyQualifiedName); } generator = (IIdentityGenerator)Activator.CreateInstance(type); } }
public ValidateOrderService( IQuoteCacheService quoteCashService, IAccountUpdateService accountUpdateService, IAccountsCacheService accountsCacheService, ITradingInstrumentsCacheService accountAssetsCacheService, IAssetPairsCache assetPairsCache, OrdersCache ordersCache, IAssetPairDayOffService assetDayOffService, IIdentityGenerator identityGenerator, IDateService dateService, MarginTradingSettings marginSettings, ICfdCalculatorService cfdCalculatorService, IFeatureManager featureManager, CorrelationContextAccessor correlationContextAccessor) { _quoteCashService = quoteCashService; _accountUpdateService = accountUpdateService; _accountsCacheService = accountsCacheService; _tradingInstrumentsCache = accountAssetsCacheService; _assetPairsCache = assetPairsCache; _ordersCache = ordersCache; _assetDayOffService = assetDayOffService; _identityGenerator = identityGenerator; _dateService = dateService; _marginSettings = marginSettings; _cfdCalculatorService = cfdCalculatorService; _featureManager = featureManager; _correlationContextAccessor = correlationContextAccessor; }
public ExternalOrderbookService( IEventChannel <BestPriceChangeEventArgs> bestPriceChangeEventChannel, IOrderBookProviderApi orderBookProviderApi, IDateService dateService, IConvertService convertService, IAssetPairDayOffService assetPairDayOffService, IScheduleSettingsCacheService scheduleSettingsCache, IAssetPairsCache assetPairsCache, ICqrsSender cqrsSender, IIdentityGenerator identityGenerator, ILog log, MarginTradingSettings marginTradingSettings) { _bestPriceChangeEventChannel = bestPriceChangeEventChannel; _orderBookProviderApi = orderBookProviderApi; _dateService = dateService; _convertService = convertService; _assetPairDayOffService = assetPairDayOffService; _scheduleSettingsCache = scheduleSettingsCache; _assetPairsCache = assetPairsCache; _cqrsSender = cqrsSender; _identityGenerator = identityGenerator; _log = log; _marginTradingSettings = marginTradingSettings; }
private IdentityGenerator() { if (AppRuntime.Instance.CurrentApplication == null) { throw new OFoodsException("该应用程序尚未初始化并且尚未启动."); } if (AppRuntime.Instance.CurrentApplication.ConfigSource == null || AppRuntime.Instance.CurrentApplication.ConfigSource.Config == null || AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators == null || AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators.IdentityGenerator == null || string.IsNullOrEmpty(AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators.IdentityGenerator.Provider) || string.IsNullOrWhiteSpace(AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators.IdentityGenerator.Provider)) { generator = new SequentialIdentityGenerator(); } else { Type type = Type.GetType(AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators.IdentityGenerator.Provider); if (type == null) { throw new OFoodsException("无法从名称{0}创建类型.", AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators.IdentityGenerator.Provider); } if (type.Equals(this.GetType())) { throw new OFoodsException("类型{0}不能用作标识生成器,它由内部的OFoods框架维护.", this.GetType().AssemblyQualifiedName); } generator = (IIdentityGenerator)Activator.CreateInstance(type); } }
public SpecialLiquidationCommandsHandler( ITradingEngine tradingEngine, IDateService dateService, IOrderReader orderReader, IChaosKitty chaosKitty, IOperationExecutionInfoRepository operationExecutionInfoRepository, ILog log, MarginTradingSettings marginTradingSettings, IAssetPairsCache assetPairsCache, IAssetPairDayOffService assetPairDayOffService, IExchangeConnectorService exchangeConnectorService, IIdentityGenerator identityGenerator, IAccountsCacheService accountsCacheService) { _tradingEngine = tradingEngine; _dateService = dateService; _orderReader = orderReader; _chaosKitty = chaosKitty; _operationExecutionInfoRepository = operationExecutionInfoRepository; _log = log; _marginTradingSettings = marginTradingSettings; _assetPairsCache = assetPairsCache; _assetPairDayOffService = assetPairDayOffService; _exchangeConnectorService = exchangeConnectorService; _identityGenerator = identityGenerator; _accountsCacheService = accountsCacheService; }
public PublishedEventPersistenter(IIdentityGenerator identityGenerator, EventBusMySQLOptions eventBusMySQLOptions, IServiceProvider serviceProvider, ILogger <PublishedEventPersistenter> logger) { _identityGenerator = identityGenerator; _eventBusMySQLOptions = eventBusMySQLOptions; _serviceProvider = serviceProvider; _logger = logger; }
public PasswordResetTokenCreator(IWriteableRepository writeableRepository, IReadOnlyRepository readOnlyRepository, ITimeProvider timeProvider, IIdentityGenerator <Guid> idGenerator) { _writeableRepository = writeableRepository; _readOnlyRepository = readOnlyRepository; _timeProvider = timeProvider; _idGenerator = idGenerator; }
private IdentityGenerator() { if (AppRuntime.Instance.CurrentApplication == null) { throw new EagleAppException("The application has not been initialized and started yet."); } if (AppRuntime.Instance.CurrentApplication.ConfigSource == null || AppRuntime.Instance.CurrentApplication.ConfigSource.Config == null || AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators == null || AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators.IdentityGenerator == null || string.IsNullOrEmpty(AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators.IdentityGenerator.Provider)) { generator = new SequentialIdentityGenerator(); } else { Type type = Type.GetType(AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators.IdentityGenerator.Provider); if (type == null) { throw new ConfigException("Unable to create the type from the name {0}.", AppRuntime.Instance.CurrentApplication.ConfigSource.Config.Generators.IdentityGenerator.Provider); } if (type.Equals(this.GetType())) { throw new EagleAppException("Type {0} cannot be used as identity generator, it is maintained by the Eagle framework internally.", this.GetType().AssemblyQualifiedName); } generator = (IIdentityGenerator)Activator.CreateInstance(type); } }
public Created(string login, string password, IIdentityGenerator identityGenerator) { Login = login; Password = password; AggregateId = identityGenerator.NewId(); }
public SecurityAggregate(SecurityAggregateState state, Action <IEvent <SecurityId> > observer, PasswordGenerator generator, IIdentityGenerator identityGenerator) { _state = state; _observer = observer; _generator = generator; _identityGenerator = identityGenerator; }
public DatabaseEngine(IIdentityGenerator identityGenerator, IObjectCloner objectCloner, string uniqueIdPropName) { _objectObjectCloner = objectCloner; _idGenerator = identityGenerator; _uniqueIdPropName = uniqueIdPropName; _collections = new ThreadLocal <Dictionary <string, Dictionary <string, dynamic> > >(); _collections.Value = new Dictionary <string, Dictionary <string, dynamic> >(); }
public PoolManager(IIdentityGenerator identityGenerator, IEventSystem eventSystem) { IdentityGenerator = identityGenerator; EventSystem = eventSystem; _groupAccessors = new Dictionary <GroupAccessorToken, IEnumerable <IEntity> >(); _pools = new Dictionary <string, IPool>(); CreatePool(DefaultPoolName); }
public RequestCorrelationFeatureTests() { generator = A.Fake <IIdentityGenerator>(); A.CallTo(() => generator.GenerateIdentity()).Returns(newId); feature = new RequestCorrelationFeature { IdentityGenerator = generator }; }
public OrderFactory(IIdentityGenerator <OrderIdentity> orderIdentityGenerator, IIdentityGenerator <OrderItemIdentity> orderItemIdentityGenerator, ITimeService timeService) { _orderIdentityGenerator = orderIdentityGenerator; _orderItemIdentityGenerator = orderItemIdentityGenerator; _timeService = timeService; }
public AggregateFactory(ITapeStorageFactory factory, IEnvelopeStreamer streamer, IQueueWriter writer, NuclearStorage storage, IIdentityGenerator generator) { _factory = factory; _streamer = streamer; _writer = writer; _storage = storage; _generator = generator; }
public RequestCorrelationFeatureTests(AppHostFixture fixture) { appHost = fixture.AppHost; generator = A.Fake <IIdentityGenerator>(); A.CallTo(() => generator.GenerateIdentity()).Returns(newId); feature = new RequestCorrelationFeature { IdentityGenerator = generator }; }
public SqlStoreSender( IIdentityGenerator identityGenerator, IRepository <PerformedOperationFinalProcessing> repository, IXmlEventSerializer serializer) { _identityGenerator = identityGenerator; _repository = repository; _serializer = serializer; }
public ExtensionsApplicationBuilder(IApplicationBuilder appBuilder, IIdentityGenerator generator = null) { this.appBuilder = appBuilder; this.generator = generator ?? new NaiveShimIdentityGenerator(0); this.middlewares = new List <Func <RequestDelegate, RequestDelegate> >(); var id = this.generator.GetId(); this.shims.Add(new Shim(id)); }
public PasswordResetTokenCreator(IPasswordResetTokenRepository tokenRepo, IUserRepository readOnlyRepository, ITimeProvider timeProvider, IIdentityGenerator <Guid> idGenerator) { _tokenRepo = tokenRepo; _readOnlyRepository = readOnlyRepository; _timeProvider = timeProvider; _idGenerator = idGenerator; }
public ServiceController( IOvernightMarginParameterContainer overnightMarginParameterContainer, IIdentityGenerator identityGenerator, ISnapshotService snapshotService) { _overnightMarginParameterContainer = overnightMarginParameterContainer; _identityGenerator = identityGenerator; _snapshotService = snapshotService; }
public InMemoryObjectStoreDelegate(StateAdapterProvider stateAdapterProvider) { _stateAdapterProvider = stateAdapterProvider; _stores = new Dictionary <Type, Dictionary <long, TState> >(); _entries = new List <TEntry>(); _dispatchables = new List <Dispatchable <TEntry, TState> >(); _identityGenerator = IdentityGeneratorType.Random.Generator(); _nextId = 1; }
public UserSessionFactory(IWriteableRepository writeableRepository, ITimeProvider timeProvider, IIdentityGenerator <Guid> identityGenerator, ITokenExpirationProvider tokenExpirationProvider) { _writeableRepository = writeableRepository; _timeProvider = timeProvider; _identityGenerator = identityGenerator; _tokenExpirationProvider = tokenExpirationProvider; }
public UserSessionFactory(IWriteableRepository writeableRepository, ITimeProvider timeProvider, IIdentityGenerator<Guid> identityGenerator, ITokenExpirationProvider tokenExpirationProvider) { _writeableRepository = writeableRepository; _timeProvider = timeProvider; _identityGenerator = identityGenerator; _tokenExpirationProvider = tokenExpirationProvider; }
public PendingOrdersCleaningService(ILog log, IOrderReader orderReader, ITradingEngine tradingEngine, IAssetPairDayOffService assetDayOffService, IIdentityGenerator identityGenerator) : base(nameof(PendingOrdersCleaningService), 60000, log) { _log = log; _orderReader = orderReader; _tradingEngine = tradingEngine; _assetDayOffService = assetDayOffService; _identityGenerator = identityGenerator; }
public SqlStoreSender( IIdentityGenerator identityGenerator, IRepository <PerformedOperationFinalProcessing> repository, IOperationSerializer <TOperation> serializer) { _identityGenerator = identityGenerator; _repository = repository; _serializer = serializer; _targetFlow = MessageFlowBase <TFlow> .Instance; }
public SalesAreaRepository( ISqlServerTenantDbContext dbContext, IIdentityGenerator identityGenerator, IMapper mapper) { _dbContext = dbContext; _identityGenerator = identityGenerator; _sequenceRebuilder = new SequenceRebuilder <Entities.Tenant.SalesAreas.SalesArea, SalesAreaNoIdentity>(); _mapper = mapper; }
public void SetUp() { BlobStore = Substitute.For<IBlobStore>(); IdentityGenerator = Substitute.For<IIdentityGenerator>(); _handleWriter = Substitute.For<IDocumentWriter>(); DocumentReader = Substitute.For<IMongoDbReader<DocumentDescriptorReadModel, DocumentDescriptorId>>(); DocumentDeletedReader = Substitute.For<IMongoDbReader<DocumentDeletedReadModel, String>>(); QueueDispatcher = Substitute.For<IQueueManager>(); CounterService = Substitute.For<ICounterService>(); var bus = Substitute.For<IInProcessCommandBus>(); var configuration = new DocumentStoreTestConfiguration(); Controller = new DocumentsController( BlobStore, configuration, IdentityGenerator, DocumentReader, DocumentDeletedReader, bus, _handleWriter, QueueDispatcher, CounterService, null) { Request = new HttpRequestMessage { RequestUri = new Uri("http://localhost/api/products") }, Logger = new ConsoleLogger(), Configuration = new HttpConfiguration(), RequestContext = { RouteData = new HttpRouteData( route: new HttpRoute(), values: new HttpRouteValueDictionary {{"controller", "file"}}) } }; // Controller.Configuration.MapHttpAttributeRoutes(); Controller.Request.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration()); }
public DocumentsController( IBlobStore blobStore, DocumentStoreConfiguration configService, IIdentityGenerator identityGenerator, IMongoDbReader<DocumentDescriptorReadModel, DocumentDescriptorId> documentDescriptorReader, IMongoDbReader<DocumentDeletedReadModel, String> documentDeletedReader, IInProcessCommandBus commandBus, IDocumentWriter handleWriter, IQueueManager queueDispatcher, ICounterService counterService, IDocumentFormatTranslator documentFormatTranslator) { _blobStore = blobStore; _configService = configService; _identityGenerator = identityGenerator; _documentDescriptorReader = documentDescriptorReader; _documentDeletedReader = documentDeletedReader; _handleWriter = handleWriter; _queueDispatcher = queueDispatcher; _counterService = counterService; _documentFormatTranslator = documentFormatTranslator; CommandBus = commandBus; }
private IdentityGenerator() { this.generator = new SequentialIdentityGenerator(); }
public AggregateRootFactory(IIdentityGenerator identityGenerator, IRepository repository) { _identityGenerator = identityGenerator; _repository = repository; }
public SrvOrdersRegistrator(IOrdersRepository ordersRepository, IIdentityGenerator identityGenerator, IOrderExecuter orderExecuter) { _ordersRepository = ordersRepository; _identityGenerator = identityGenerator; _orderExecuter = orderExecuter; }
public UserService(IStorage<User> storage, ICryptographyService cryptographyService, IIdentityGenerator identityGenerator) { this.storage = storage; this.cryptographyService = cryptographyService; this.identityGenerator = identityGenerator; }
public EmployeeCreated(string name, IIdentityGenerator identityGenerator) { this.Name = name; this.AggregateId = identityGenerator.NewId(); }
public AggregateRootFactory(IIdentityGenerator identityGenerator, IRepository repository, IAccountIndexStore accountIndexStore) { _identityGenerator = identityGenerator; _repository = repository; _accountIndexStore = accountIndexStore; }