/// <summary> /// Instantiates a <see cref="MarketDataSubscription"/> /// </summary> /// <param name="logger">The logger</param> /// <param name="repositoryFactory">The repository to store and retrieve market data</param> /// <param name="marketDataProvider">The provider for refreshing market data</param> /// <param name="stockListProvider">The provider for lists of stocks for which to retrieve data</param> /// <param name="quotesPublisher"></param> /// <param name="subscriptionData">The subscriptionData data for determining</param> public MarketDataSubscription(ILog logger, IMarketDataRepositoryFactory repositoryFactory, IMarketDataProvider marketDataProvider, IStockListProvider stockListProvider, IPublisher<NewQuotesData> quotesPublisher, Subscription subscriptionData) { // perform null checks if (logger == null) throw new ArgumentNullException("logger"); if (repositoryFactory == null) throw new ArgumentNullException("repositoryFactory"); if (marketDataProvider == null) throw new ArgumentNullException("marketDataProvider"); if (subscriptionData == null) throw new ArgumentNullException("subscriptionData"); // set dependencies _logger = logger; _repositoryFactory = repositoryFactory; _marketDataProvider = marketDataProvider; _stockListProvider = stockListProvider; _quotesPublisher = quotesPublisher; _subscriptionData = subscriptionData; // set up timer _timer = new Timer(obj => GetLatestQuotes()); // status initialized to idle Status = SubscriptionStatus.Idle; }
/// <summary> /// Instantiates a <see cref="SubscriptionFactory"/> /// </summary> /// <param name="logger"></param> /// <param name="repositoryFactory"></param> /// <param name="marketDataProviders"></param> /// <param name="stockListProviders"></param> /// <param name="publisherFactory"></param> public SubscriptionFactory(ILog logger, IMarketDataRepositoryFactory repositoryFactory, IEnumerable <IMarketDataProvider> marketDataProviders, IEnumerable <IStockListProvider> stockListProviders, IPublisherFactory publisherFactory) { _logger = logger; _repositoryFactory = repositoryFactory; _marketDataProviders = marketDataProviders; _stockListProviders = stockListProviders; _publisherFactory = publisherFactory; }
/// <summary> /// Instantiates a <see cref="SubscriptionFactory"/> /// </summary> /// <param name="logger"></param> /// <param name="repositoryFactory"></param> /// <param name="marketDataProviders"></param> /// <param name="stockListProviders"></param> /// <param name="publisherFactory"></param> public SubscriptionFactory(ILog logger, IMarketDataRepositoryFactory repositoryFactory, IEnumerable<IMarketDataProvider> marketDataProviders, IEnumerable<IStockListProvider> stockListProviders, IPublisherFactory publisherFactory) { _logger = logger; _repositoryFactory = repositoryFactory; _marketDataProviders = marketDataProviders; _stockListProviders = stockListProviders; _publisherFactory = publisherFactory; }
/// <summary> /// Instantiates an <see cref="EmailFeed"/> /// </summary> /// <param name="emailManagerFactory"></param> /// <param name="marketDataRepositoryFactory"></param> /// <param name="emailFeedConfiguration"></param> public EmailFeed(IEmailManagerFactory emailManagerFactory, IMarketDataRepositoryFactory marketDataRepositoryFactory, EmailFeedConfiguration emailFeedConfiguration) { // set config _emailManagerFactory = emailManagerFactory; _marketDataRepositoryFactory = marketDataRepositoryFactory; _emailFeedConfiguration = emailFeedConfiguration; // create email manager _emailManager = _emailFeedConfiguration.CreateEmailManager(_emailManagerFactory); // set last polled time _lastPolled = _emailFeedConfiguration.LastChecked; // create timer _pollingTimer = new Timer(obj => RetrieveNewEmails()); }
/// <summary> /// Instantiates an <see cref="EmailFeed"/> /// </summary> /// <param name="emailManagerFactory"></param> /// <param name="marketDataRepositoryFactory"></param> /// <param name="emailFeedConfiguration"></param> public EmailFeed(IEmailManagerFactory emailManagerFactory, IMarketDataRepositoryFactory marketDataRepositoryFactory, EmailFeedConfiguration emailFeedConfiguration) { // set config _emailManagerFactory = emailManagerFactory; _marketDataRepositoryFactory = marketDataRepositoryFactory; _emailFeedConfiguration = emailFeedConfiguration; // create email manager _emailManager = _emailFeedConfiguration.CreateEmailManager(_emailManagerFactory); // set last polled time _lastPolled = _emailFeedConfiguration.LastChecked; // create timer _pollingTimer = new Timer(obj => RetrieveNewEmails()); }
/// <summary> /// Instantiates a <see cref="MarketDataSubscription"/> /// </summary> /// <param name="logger">The logger</param> /// <param name="repositoryFactory">The repository to store and retrieve market data</param> /// <param name="marketDataProvider">The provider for refreshing market data</param> /// <param name="stockListProvider">The provider for lists of stocks for which to retrieve data</param> /// <param name="quotesPublisher"></param> /// <param name="subscriptionData">The subscriptionData data for determining</param> public MarketDataSubscription(ILog logger, IMarketDataRepositoryFactory repositoryFactory, IMarketDataProvider marketDataProvider, IStockListProvider stockListProvider, IPublisher <NewQuotesData> quotesPublisher, Subscription subscriptionData) { // perform null checks if (logger == null) { throw new ArgumentNullException("logger"); } if (repositoryFactory == null) { throw new ArgumentNullException("repositoryFactory"); } if (marketDataProvider == null) { throw new ArgumentNullException("marketDataProvider"); } if (subscriptionData == null) { throw new ArgumentNullException("subscriptionData"); } // set dependencies _logger = logger; _repositoryFactory = repositoryFactory; _marketDataProvider = marketDataProvider; _stockListProvider = stockListProvider; _quotesPublisher = quotesPublisher; _subscriptionData = subscriptionData; // set up timer _timer = new Timer(obj => GetLatestQuotes()); // status initialized to idle Status = SubscriptionStatus.Idle; }
/// <summary> /// Instantiates a <see cref="MarketDataService"/> /// </summary> /// <param name="repositoryFactory"></param> public MarketDataService(IMarketDataRepositoryFactory repositoryFactory) { _repositoryFactory = repositoryFactory; }
/// <summary> /// Instantiates an <see cref="EmailFeedFactory"/> /// </summary> /// <param name="emailManagerFactory"></param> /// <param name="repositoryFactory"></param> public EmailFeedFactory(IEmailManagerFactory emailManagerFactory, IMarketDataRepositoryFactory repositoryFactory) { _emailManagerFactory = emailManagerFactory; _repositoryFactory = repositoryFactory; }
/// <summary> /// Instantiates an <see cref="EmailFeedFactory"/> /// </summary> /// <param name="emailManagerFactory"></param> /// <param name="repositoryFactory"></param> public EmailFeedFactory(IEmailManagerFactory emailManagerFactory, IMarketDataRepositoryFactory repositoryFactory) { _emailManagerFactory = emailManagerFactory; _repositoryFactory = repositoryFactory; }