Exemplo n.º 1
0
 public ModuleService(ModuleServiceConfig config, ILogger <ModuleService> logger, //ModuleMessageAdder addMessage,
                      IDbServicesFactory factory)
 {
     this.config = config;
     this.logger = logger;
     //this.addMessage = addMessage;
     this.dbFactory = factory;
 }
Exemplo n.º 2
0
 public FileService(ILogger <FileService> logger, IDbServicesFactory factory, FileServiceConfig config,
                    S3Provider provider, IImageManipulator imageManip)
 {
     this.dbFactory  = factory;
     this.config     = config;
     this.s3Provider = provider;
     this.logger     = logger;
     this.imageManip = imageManip;
 }
Exemplo n.º 3
0
 public BaseControllerServices(ILogger <BaseController> logger, IAuthTokenService <long> authService,
                               IMapper mapper, IEventTracker tracker, RateLimitConfig rateConfig, IDbServicesFactory factory)
 {
     this.logger      = logger;
     this.authService = authService;
     this.mapper      = mapper;
     this.tracker     = tracker;
     this.rateConfig  = rateConfig;
     this.dbFactory   = factory;
 }
Exemplo n.º 4
0
 public LiveEventQueue(ILogger <LiveEventQueue> logger, LiveEventQueueConfig config, ICacheCheckpointTracker <LiveEvent> tracker, IDbServicesFactory factory,
                       IPermissionService permissionService, IMapper mapper)
 {
     this.logger            = logger;
     this.eventTracker      = tracker;
     this.dbFactory         = factory;
     this.permissionService = permissionService;
     this.config            = config;
     this.mapper            = mapper;
 }
Exemplo n.º 5
0
 public UserService(ILogger <UserService> logger, IHashService hashService, IAuthTokenService <long> authTokenService,
                    UserServiceConfig config, IDbServicesFactory factory, IViewTypeInfoService typeInfoService)
 {
     this.logger           = logger;
     this.hashService      = hashService;
     this.authTokenService = authTokenService;
     this.config           = config;
     this.dbFactory        = factory;
     this.typeInfoService  = typeInfoService;
     userTable             = typeInfoService.GetDatabaseForType <UserView>();
 }
Exemplo n.º 6
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="dhuNodeDefinition">Конфигурация узла.</param>
        public DataNodeReader(DataNodeDefinition dhuNodeDefinition, IDbServicesFactory timeServiceFactory)
        {
            if (dhuNodeDefinition == null)
            {
                throw new ArgumentNullException("dhuNodeDefinition");
            }

            this.nodeDefinition = dhuNodeDefinition;

            var url = this.nodeDefinition.ServiceUri.ToString();

            this.client             = new MongoClient(url);
            this.database           = client.GetDatabase(TransportConstants.MongoDatabaseName);
            this.settingsCollection = this.database.GetCollection <GlobalSetting>(TransportConstants.GlobalSettingTable);

            this.packetsPartsCollection = this.database.GetCollection <PacketPart>(TransportConstants.PacketsPartsTable);
            this.timeService            = timeServiceFactory.GetTimeService(url, TransportConstants.MongoDatabaseName, TimeSpan.FromMinutes(30));
            this.disposeCts             = new CancellationTokenSource();
        }
Exemplo n.º 7
0
    public DbUnitTestBase()
    {
        //Ensure the connection for this particular class is DEFINITELY unique for this class!
        masterConnection = new SqliteConnection(MasterConnectionString);
        masterConnection.Open(); //We need to keep the master connection open so it doesn't delete the in memory database

        //Insert database structure here
        var queries = GetAllQueries();

        //Each of these could have a transaction, sooo
        foreach (var q in queries)
        {
            masterConnection.Execute(q, null); //, trans);
        }
        masterBackupConnection = new SqliteConnection(MasterBackupConnectionString);
        masterBackupConnection.Open(); //We need to keep the master connection open so it doesn't delete the in memory database
        SetBackupNow();

        dbFactory = GetService <IDbServicesFactory>();
    }
Exemplo n.º 8
0
        public void OnCreate()
        {
            //пул читателей DHU
            var dhuNodeDefinitions = settings.DataNodes;

            this.dbServicesFactory   = new MongoDbServicesFactory(this.dpuIdProvider);
            this.dataNodeReadersPool = new DataNodeReadersPool(dhuNodeDefinitions, this.settings.PriorityNodes, this.dbServicesFactory);

            //DataProcessingProfilingUnit.Unit.KnownDhuNodes(DObjectSnapshotProducer.MakeSnapshot(dhuNodeDefinitions.Select(x => x.ServiceUri)));

            //фабрики контейнеров процессоров
            this.processorContainers = this.processorManagers
                                       .Where(p => p.IsEnabled)
                                       .GroupBy(x => x.Id)
                                       .ToDictionary(p => p.Key, p => p.Select(x => x.GetProcessorContainerFactory().GetProcessorContainer()).ToArray());

            //DataProcessingProfilingUnit.Unit.KnownDpuProcessors(DObjectSnapshotProducer.MakeSnapshot(processorFactories.Select(x => x.Id)));

            var connectionAppName = this.GetRandomSqlConnectionAppName();
            //DataProcessingProfilingUnit.Unit.ConnectionAppName(connectionAppName);
            var connectionString = this.settings.PcdConnectionString + connectionAppName;
        }
Exemplo n.º 9
0
 public DbClusterSearchUtils(IDbServicesFactory dbServicesFactory)
 {
     this.dbServicesFactory = dbServicesFactory;
 }
Exemplo n.º 10
0
 public ShortcutsService(ILogger <ShortcutsService> logger, IDbServicesFactory factory, IMapper mapper)
 {
     this.dbFactory = factory;
     this.logger    = logger;
     this.mapper    = mapper;
 }
Exemplo n.º 11
0
        public DataNodeReadersPool(DataNodeDefinition[] dhuNodeDefinitions, IEnumerable <DataNodeDefinition> prioritedNodes, IDbServicesFactory timeServiceFactory)
        {
            if (dhuNodeDefinitions != null)
            {
                this.nodeReaders = dhuNodeDefinitions
                                   .Select(ndf => new DataNodeReader(ndf, timeServiceFactory))
                                   .ToArray();
            }
            else
            {
                this.nodeReaders = new DataNodeReader[0];
            }

            this.prioritedNodes = prioritedNodes;
        }