示例#1
0
 public RoatpController(IDownloadServiceApiClient apiClient, IRoatpMapper mapper, IRetryService retryService, ILogger <RoatpController> logger)
 {
     _apiClient    = apiClient;
     _mapper       = mapper;
     _retryService = retryService;
     _logger       = logger;
 }
示例#2
0
        public void Init()
        {
            _ukprn      = 12345678;
            _mockLogger = new Mock <ILogger <ProvidersController> >();
            _mockClient = new Mock <IRoatpApiClient>();

            _mockEnv = new Mock <IHostingEnvironment>();
            _mockRetryServiceLogger = new Mock <ILogger <RetryService> >();
            _retryService           = new RetryService(_mockRetryServiceLogger.Object);

            _mapper = new RoatpMapper();
            _mockClient.Setup(z => z.GetRoatpSummaryByUkprn(It.IsAny <int>())).ReturnsAsync((IEnumerable <RoatpResult>)null);
            _mockClient.Setup(z => z.GetRoatpSummary()).ReturnsAsync((IEnumerable <RoatpResult>)null);

            HttpContextRequest = new Mock <HttpRequest>();
            HttpContextRequest.Setup(r => r.Method).Returns("GET");
            HttpContext = new Mock <HttpContext>();
            HttpContext.Setup(x => x.Request.Scheme).Returns("http");
            HttpContext.Setup(x => x.Request.Host).Returns(new HostString("localhost"));

            _controller = new ProvidersController(_mockLogger.Object, _mockClient.Object, _mapper,
                                                  _mockEnv.Object, _retryService);

            _controller.ControllerContext             = new ControllerContext();
            _controller.ControllerContext.HttpContext = HttpContext.Object;
        }
示例#3
0
 /// <summary>Parameterized constructor.
 /// </summary>
 /// <param name="processingCommandCache"></param>
 /// <param name="commandAsyncResultManager"></param>
 /// <param name="aggregateRootTypeProvider"></param>
 /// <param name="aggregateRootFactory"></param>
 /// <param name="memoryCache"></param>
 /// <param name="repository"></param>
 /// <param name="retryCommandService"></param>
 /// <param name="eventStore"></param>
 /// <param name="eventPublisher"></param>
 /// <param name="retryService"></param>
 /// <param name="eventSynchronizerProvider"></param>
 /// <param name="loggerFactory"></param>
 public DefaultUncommittedEventExecutor(
     IProcessingCommandCache processingCommandCache,
     ICommandAsyncResultManager commandAsyncResultManager,
     IAggregateRootTypeProvider aggregateRootTypeProvider,
     IAggregateRootFactory aggregateRootFactory,
     IMemoryCache memoryCache,
     IRepository repository,
     IRetryCommandService retryCommandService,
     IEventStore eventStore,
     IEventPublisher eventPublisher,
     IRetryService retryService,
     IEventSynchronizerProvider eventSynchronizerProvider,
     ILoggerFactory loggerFactory)
 {
     _processingCommandCache    = processingCommandCache;
     _commandAsyncResultManager = commandAsyncResultManager;
     _aggregateRootTypeProvider = aggregateRootTypeProvider;
     _aggregateRootFactory      = aggregateRootFactory;
     _memoryCache               = memoryCache;
     _repository                = repository;
     _retryCommandService       = retryCommandService;
     _eventStore                = eventStore;
     _eventPublisher            = eventPublisher;
     _retryService              = retryService;
     _eventSynchronizerProvider = eventSynchronizerProvider;
     _logger = loggerFactory.Create(GetType().Name);
 }
示例#4
0
        /// <summary>Parameterized constructor.
        /// </summary>
        /// <param name="processingCommandCache"></param>
        /// <param name="commandAsyncResultManager"></param>
        /// <param name="commandHandlerProvider"></param>
        /// <param name="aggregateRootTypeProvider"></param>
        /// <param name="eventSender"></param>
        /// <param name="retryService"></param>
        /// <param name="commandContext"></param>
        /// <param name="loggerFactory"></param>
        /// <exception cref="Exception"></exception>
        public DefaultCommandExecutor(
            IProcessingCommandCache processingCommandCache,
            ICommandAsyncResultManager commandAsyncResultManager,
            ICommandHandlerProvider commandHandlerProvider,
            IAggregateRootTypeProvider aggregateRootTypeProvider,
            IEventSender eventSender,
            IRetryService retryService,
            ICommandContext commandContext,
            ILoggerFactory loggerFactory)
        {
            _processingCommandCache    = processingCommandCache;
            _commandAsyncResultManager = commandAsyncResultManager;
            _commandHandlerProvider    = commandHandlerProvider;
            _aggregateRootTypeProvider = aggregateRootTypeProvider;
            _eventSender     = eventSender;
            _retryService    = retryService;
            _commandContext  = commandContext;
            _trackingContext = commandContext as ITrackingContext;
            _logger          = loggerFactory.Create(GetType().Name);

            if (_trackingContext == null)
            {
                throw new Exception("Command context must also implement ITrackingContext interface.");
            }
        }
 public StateMachinePersisted(
     IEventPersistedStore <TKey, TState, TEvent, TParam, TCtx, TUserId> eventPersistedStore,
     IRetryService retryService)
 {
     this.eventPersistedStore = eventPersistedStore;
     this.retryService        = retryService;
 }
示例#6
0
 public ProvidersController(ILogger <ProvidersController> log, IRoatpApiClient apiClient, IRoatpMapper mapper, IHostingEnvironment hostingEnv, IRetryService retryService)
 {
     _log          = log;
     _apiClient    = apiClient;
     _mapper       = mapper;
     _hostingEnv   = hostingEnv;
     _retryService = retryService;
 }
 public DefaultCommittedEventExecutor(
     IEventHandlerProvider eventHandlerProvider,
     IEventPublishInfoStore eventPublishInfoStore,
     IEventHandleInfoStore eventHandleInfoStore,
     IRetryService retryService,
     ILoggerFactory loggerFactory)
 {
     _eventHandlerProvider  = eventHandlerProvider;
     _eventPublishInfoStore = eventPublishInfoStore;
     _eventHandleInfoStore  = eventHandleInfoStore;
     _retryService          = retryService;
     _logger = loggerFactory.Create(GetType().Name);
 }
示例#8
0
 public Context(
     long stateMachineKey,
     TestState currentState,
     uint size,
     IEventPersistedStore <long, TestState, TestEvent, string, Context, Guid> eventPersistedStore,
     IRetryService retryService,
     NewEventReceived <long, TestState, TestEvent, Context, string, Guid> newEventReceived,
     int maxDelay = 600) : base(
         stateMachineKey,
         currentState,
         size,
         eventPersistedStore,
         retryService,
         newEventReceived,
         maxDelay)
 {
 }
示例#9
0
 public AbstractStateMachinePersistCtx(
     TKey stateMachineKey,
     TState currentState,
     uint size,
     IEventPersistedStore <TKey, TState, TEvent, TParam, TCtx, TUserId> eventPersistedStore,
     IRetryService retryService,
     NewEventReceived <TKey, TState, TEvent, TCtx, TParam, TUserId> newEventReceived,
     int maxDelay = 10 * 60)
 {
     this.CurrentState        = currentState;
     this.StateMachineKey     = stateMachineKey;
     this.skipQueue           = new SkipQueue <EventActionNodePersist <TKey, TState, TEvent, TParam, TCtx, TUserId> >(size);
     this.eventPersistedStore = eventPersistedStore;
     this.retryService        = retryService;
     this.maxDelay            = maxDelay;
     this.newEventReceived    = newEventReceived;
 }
 /// <summary>Parameterized costructor.
 /// </summary>
 /// <param name="commandAsyncResultManager"></param>
 /// <param name="retryService"></param>
 /// <param name="loggerFactory"></param>
 public DefaultRetryCommandService(ICommandAsyncResultManager commandAsyncResultManager, IRetryService retryService, ILoggerFactory loggerFactory)
 {
     _commandAsyncResultManager = commandAsyncResultManager;
     _retryService = retryService;
     _logger = loggerFactory.Create(GetType().Name);
 }
示例#11
0
 public StreamCopyService(IRetryService retry)
 {
     _retry = retry;
 }
 /// <summary>Parameterized constructor.
 /// </summary>
 /// <param name="retryService"></param>
 public DefaultCommandAsyncResultManager(IRetryService retryService)
 {
     _retryService = retryService;
 }
 /// <summary>Parameterized costructor.
 /// </summary>
 /// <param name="commandAsyncResultManager"></param>
 /// <param name="retryService"></param>
 /// <param name="loggerFactory"></param>
 public DefaultRetryCommandService(ICommandAsyncResultManager commandAsyncResultManager, IRetryService retryService, ILoggerFactory loggerFactory)
 {
     _commandAsyncResultManager = commandAsyncResultManager;
     _retryService = retryService;
     _logger       = loggerFactory.Create(GetType().Name);
 }