/// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public Consumer(ILastReadFeedItemDAO lastReadFeedItemDao, IAmACommandProcessor commandProcessor, ILog logger)
 {
     _lastReadFeedItemDao = lastReadFeedItemDao;
     _commandProcessor    = commandProcessor;
     _logger          = logger;
     _atomFeedGateway = new AtomFeedGateway(_lastReadFeedItemDao, _logger);
     _retryPolicy     = Policy
                        .Handle <ApplicationException>()
                        .RetryForever(exception => logger.WarnException("Error connecting to the server - will retry", exception));
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="T:System.Object"/> class.
 /// </summary>
 public Consumer(ILastReadFeedItemDAO lastReadFeedItemDao, IAmACommandProcessor commandProcessor, ILog logger)
 {
     _lastReadFeedItemDao = lastReadFeedItemDao;
     _commandProcessor = commandProcessor;
     _logger = logger;
     _atomFeedGateway = new AtomFeedGateway(_lastReadFeedItemDao, _logger);
     _retryPolicy = Policy
         .Handle<ApplicationException>()
         .RetryForever(exception => logger.WarnException("Error connecting to the server - will retry", exception));
 }
Beispiel #3
0
        public ReferenceDataFeedReader(ILastReadFeedItemDAO lastReadFeedItemDao, AtomFeed atomfeed)
        {
            _lastReadFeedItemDao = lastReadFeedItemDao;
            _atomfeed            = atomfeed;

            _lastReadFeedItem = _lastReadFeedItemDao.FindByFeedId(atomfeed.Id);
            if (_lastReadFeedItem == null)
            {
                using (var scope = _lastReadFeedItemDao.BeginTransaction())
                {
                    _lastReadFeedItem = _lastReadFeedItemDao.Add(new LastReadFeedItem(atomfeed.Id, Guid.Empty));
                    scope.Commit();
                }
            }
        }
Beispiel #4
0
 public AtomFeedGateway(ILastReadFeedItemDAO lastReadFeedItemDao, ILog logger)
 {
     _lastReadFeedItemDao = lastReadFeedItemDao;
     _logger  = logger;
     _timeout = 5000;
 }
 public AtomFeedGateway(ILastReadFeedItemDAO lastReadFeedItemDao, ILog logger)
 {
     _lastReadFeedItemDao = lastReadFeedItemDao;
     _logger = logger;
     _timeout = 5000;
 }