Build <TExecutor>(IConfigurationStore configStore, ILoggerFactory logger, IServiceExceptionHandler serviceExceptionHandler, RepositoryBase repository, RepositoryBase auxRepository, IProjectProxy projectProxy = null, IProductivity3dV2ProxyNotification productivity3dV2ProxyNotification = null, IProductivity3dV2ProxyCompaction productivity3dV2ProxyCompaction = null, IFileImportProxy fileImportProxy = null /*, IGeofenceProxy geofenceProxy = null, * IUnifiedProductivityProxy unifiedProductivityProxy = null */ ) where TExecutor : RequestExecutorContainer, new() { var executor = new TExecutor { configStore = configStore, log = logger.CreateLogger <TExecutor>(), serviceExceptionHandler = serviceExceptionHandler, projectProxy = projectProxy, Productivity3dV2ProxyNotification = productivity3dV2ProxyNotification, Productivity3dV2ProxyCompaction = productivity3dV2ProxyCompaction, fileImportProxy = fileImportProxy, Repository = repository, auxRepository = auxRepository, //GeofenceProxy = geofenceProxy, //UnifiedProductivityProxy = unifiedProductivityProxy }; return(executor); }
/// <summary> /// This constructor allows us to mock raptorClient /// </summary> public UpsertFilterExecutor(IConfigurationStore configStore, ILoggerFactory logger, IServiceExceptionHandler serviceExceptionHandler, IProjectProxy projectProxy, IProductivity3dV2ProxyNotification productivity3dV2ProxyNotification, IProductivity3dV2ProxyCompaction productivity3dV2ProxyCompaction, IFileImportProxy fileImportProxy, RepositoryBase repository, RepositoryBase auxRepository /*, IGeofenceProxy geofenceProxy */) : base(configStore, logger, serviceExceptionHandler, projectProxy, productivity3dV2ProxyNotification, productivity3dV2ProxyCompaction, fileImportProxy, repository, auxRepository /*, geofenceProxy, null*/) { }
/// <summary> /// This constructor allows us to mock raptorClient /// </summary> public DeleteFilterExecutor(IConfigurationStore configStore, ILoggerFactory logger, IServiceExceptionHandler serviceExceptionHandler, IProjectProxy projectProxy, IProductivity3dV2ProxyNotification productivity3dV2ProxyNotification, IProductivity3dV2ProxyCompaction productivity3dV2ProxyCompaction, IFileImportProxy fileImportProxy, RepositoryBase repository) : base(configStore, logger, serviceExceptionHandler, projectProxy, productivity3dV2ProxyNotification, productivity3dV2ProxyCompaction, fileImportProxy, repository, null /*, null, null */) { }
/// <summary> /// Initializes a new instance of the <see cref="FilterController"/> class. /// </summary> public FilterController(IConfigurationStore configStore, ILoggerFactory logger, IServiceExceptionHandler serviceExceptionHandler, IProjectProxy projectProxy, IProductivity3dV2ProxyNotification productivity3dV2ProxyNotification, IProductivity3dV2ProxyCompaction productivity3dV2ProxyCompaction, IRepository <IFilterEvent> filterRepo, IRepository <IGeofenceEvent> geofenceRepo) : base(configStore, logger, serviceExceptionHandler, projectProxy, productivity3dV2ProxyNotification, productivity3dV2ProxyCompaction, "IFilterEvent") { Log = logger.CreateLogger <FilterController>(); this.filterRepo = filterRepo as FilterRepository; geofenceRepository = geofenceRepo as GeofenceRepository; }
public AssetStatusJob(IAssetStatusServerHubClient assetStatusServerHubClient, IFleetAssetDetailsProxy assetDetailsProxy, IFleetAssetSummaryProxy assetSummaryProxy, IProductivity3dV2ProxyNotification productivity3dV2ProxyNotification, ILoggerFactory logger) { this._assetStatusServerHubClient = assetStatusServerHubClient; _log = logger.CreateLogger <AssetStatusJob>(); this._assetDetailsProxy = assetDetailsProxy; this._productivity3dV2ProxyNotification = productivity3dV2ProxyNotification; this._assetSummaryProxy = assetSummaryProxy; }
/// <summary> /// Initializes a new instance of the <see cref="BoundaryController"/> class. /// </summary> public BoundaryController(IConfigurationStore configStore, ILoggerFactory logger, IServiceExceptionHandler serviceExceptionHandler, IProjectProxy projectProxy, IProductivity3dV2ProxyNotification productivity3dV2ProxyNotification, IProductivity3dV2ProxyCompaction productivity3dV2ProxyCompaction, IRepository <IGeofenceEvent> geofenceRepo, IRepository <IProjectEvent> projectRepo) : base(configStore, logger, serviceExceptionHandler, projectProxy, productivity3dV2ProxyNotification, productivity3dV2ProxyCompaction, "IBoundaryEvent") { Log = logger.CreateLogger <BoundaryController>(); _geofenceRepository = geofenceRepo as GeofenceRepository; _projectRepository = projectRepo as ProjectRepository; }
/// <summary> /// Default constructor. /// </summary> protected BaseController(IConfigurationStore configStore, ILoggerFactory logger, IServiceExceptionHandler serviceExceptionHandler, IProjectProxy projectProxy, IProductivity3dV2ProxyNotification productivity3dV2ProxyNotification, IProductivity3dV2ProxyCompaction productivity3dV2ProxyCompaction, string eventType) { Logger = logger; Log = logger.CreateLogger <BaseController>(); ConfigStore = configStore; ServiceExceptionHandler = serviceExceptionHandler; ProjectProxy = projectProxy; Productivity3dV2ProxyNotification = productivity3dV2ProxyNotification; Productivity3dV2ProxyCompaction = productivity3dV2ProxyCompaction; }
//protected IGeofenceProxy GeofenceProxy; //protected IUnifiedProductivityProxy UnifiedProductivityProxy; public void SetupDI() { ServiceProvider = new ServiceCollection() .AddLogging() .AddHttpClient() .AddSingleton(new LoggerFactory().AddSerilog(SerilogExtensions.Configure("VSS.Filter.ExecutorTests.log"))) .AddSingleton <IConfigurationStore, GenericConfiguration>() .AddTransient <IRepository <IFilterEvent>, FilterRepository>() .AddTransient <IRepository <IProjectEvent>, ProjectRepository>() .AddTransient <IRepository <IGeofenceEvent>, GeofenceRepository>() .AddTransient <IServiceExceptionHandler, ServiceExceptionHandler>() // for serviceDiscovery .AddServiceDiscovery() .AddTransient <IWebRequest, GracefulWebRequest>() .AddMemoryCache() .AddSingleton <IDataCache, InMemoryDataCache>() .AddTransient <IAssetResolverProxy, AssetResolverProxy>() .AddTransient <IWebRequest, GracefulWebRequest>() .AddTransient <IProductivity3dV2ProxyNotification, Productivity3dV2ProxyNotification>() .AddTransient <IProductivity3dV2ProxyCompaction, Productivity3dV2ProxyCompaction>() .AddTransient <IErrorCodesProvider, FilterErrorCodesProvider>() .AddSingleton <IDataCache, InMemoryDataCache>() //.AddSingleton<IGeofenceProxy, GeofenceProxy>() //.AddSingleton<IUnifiedProductivityProxy, UnifiedProductivityProxy>() .AddSingleton <IProjectProxy, ProjectV6Proxy>() .AddSingleton <IFileImportProxy, FileImportV6Proxy>() .BuildServiceProvider(); ConfigStore = ServiceProvider.GetRequiredService <IConfigurationStore>(); Logger = ServiceProvider.GetRequiredService <ILoggerFactory>(); ServiceExceptionHandler = ServiceProvider.GetRequiredService <IServiceExceptionHandler>(); FilterRepo = ServiceProvider.GetRequiredService <IRepository <IFilterEvent> >() as FilterRepository; ProjectRepo = ServiceProvider.GetRequiredService <IRepository <IProjectEvent> >() as ProjectRepository; GeofenceRepo = ServiceProvider.GetRequiredService <IRepository <IGeofenceEvent> >() as GeofenceRepository; ProjectProxy = ServiceProvider.GetRequiredService <IProjectProxy>(); FileImportProxy = ServiceProvider.GetRequiredService <IFileImportProxy>(); Productivity3dV2ProxyNotification = ServiceProvider.GetRequiredService <IProductivity3dV2ProxyNotification>(); Productivity3dV2ProxyCompaction = ServiceProvider.GetRequiredService <IProductivity3dV2ProxyCompaction>(); //GeofenceProxy = ServiceProvider.GetRequiredService<IGeofenceProxy>(); //UnifiedProductivityProxy = ServiceProvider.GetRequiredService<IUnifiedProductivityProxy>(); Assert.IsNotNull(ServiceProvider.GetService <ILoggerFactory>()); }
/// <summary> /// Injected constructor for mocking Raptor client. /// </summary> protected RequestExecutorContainer(IConfigurationStore configStore, ILoggerFactory logger, IServiceExceptionHandler serviceExceptionHandler, IProjectProxy projectProxy, IProductivity3dV2ProxyNotification productivity3dV2ProxyNotification, IProductivity3dV2ProxyCompaction productivity3dV2ProxyCompaction, IFileImportProxy fileImportProxy, RepositoryBase repository, RepositoryBase auxRepository /*, IGeofenceProxy geofenceProxy, IUnifiedProductivityProxy unifiedProductivityProxy */) : this() { this.configStore = configStore; if (logger != null) { log = logger.CreateLogger <RequestExecutorContainer>(); } this.serviceExceptionHandler = serviceExceptionHandler; this.projectProxy = projectProxy; Productivity3dV2ProxyNotification = productivity3dV2ProxyNotification; Productivity3dV2ProxyCompaction = productivity3dV2ProxyCompaction; Repository = repository; this.auxRepository = auxRepository; this.fileImportProxy = fileImportProxy; //GeofenceProxy = geofenceProxy; //UnifiedProductivityProxy = unifiedProductivityProxy; }