Example #1
0
 public DiscoveryApp(IDiscoveryConfigurationProvider configurationProvider, INodesLocator nodesLocator, ILogger logger, IDiscoveryManager discoveryManager, INodeFactory nodeFactory, INodeTable nodeTable, IMessageSerializationService messageSerializationService, ICryptoRandom cryptoRandom, IDiscoveryStorage discoveryStorage)
 {
     _configurationProvider = configurationProvider;
     _nodesLocator          = nodesLocator;
     _logger                      = logger;
     _discoveryManager            = discoveryManager;
     _nodeFactory                 = nodeFactory;
     _nodeTable                   = nodeTable;
     _messageSerializationService = messageSerializationService;
     _cryptoRandom                = cryptoRandom;
     _discoveryStorage            = discoveryStorage;
     _discoveryStorage.StartBatch();
 }
 public DiscoveryManager(
     ILogger logger,
     IDiscoveryConfigurationProvider configurationProvider,
     INodeLifecycleManagerFactory nodeLifecycleManagerFactory,
     INodeFactory nodeFactory, INodeTable nodeTable, IDiscoveryStorage discoveryStorage)
 {
     _logger = logger;
     _configurationProvider       = configurationProvider;
     _nodeLifecycleManagerFactory = nodeLifecycleManagerFactory;
     _nodeFactory      = nodeFactory;
     _nodeTable        = nodeTable;
     _discoveryStorage = discoveryStorage;
     _nodeLifecycleManagerFactory.DiscoveryManager = this;
 }
 public DiscoveryManager(INodeLifecycleManagerFactory nodeLifecycleManagerFactory,
                         INodeFactory nodeFactory,
                         INodeTable nodeTable,
                         IDiscoveryStorage discoveryStorage,
                         IConfigProvider configurationProvider,
                         ILogManager logManager)
 {
     _logger = logManager.GetClassLogger();
     _configurationProvider       = configurationProvider.GetConfig <NetworkConfig>();
     _nodeLifecycleManagerFactory = nodeLifecycleManagerFactory;
     _nodeFactory      = nodeFactory;
     _nodeTable        = nodeTable;
     _discoveryStorage = discoveryStorage;
     _nodeLifecycleManagerFactory.DiscoveryManager = this;
 }
Example #4
0
        public void Initialize()
        {
            var logger = new SimpleConsoleLogger();

            _configurationProvider            = new DiscoveryConfigurationProvider(new NetworkHelper(logger));
            _configurationProvider.DbBasePath = Path.Combine(Path.GetTempPath(), "DiscoveryStorageTests");

            var dbPath = Path.Combine(_configurationProvider.DbBasePath, FullDbOnTheRocks.DiscoveryNodesDbPath);

            if (Directory.Exists(dbPath))
            {
                Directory.GetFiles(dbPath).ToList().ForEach(File.Delete);
            }

            _nodeFactory      = new NodeFactory();
            _discoveryStorage = new DiscoveryStorage(_configurationProvider, _nodeFactory, logger, new PerfService(logger));
        }
        public void Initialize()
        {
            var logManager = NullLogManager.Instance;

            _configurationProvider = new JsonConfigProvider();
            ((NetworkConfig)_configurationProvider.GetConfig <NetworkConfig>()).DbBasePath = Path.Combine(Path.GetTempPath(), "DiscoveryStorageTests");

            var dbPath = Path.Combine(_configurationProvider.GetConfig <NetworkConfig>().DbBasePath, FullDbOnTheRocks.DiscoveryNodesDbPath);

            if (Directory.Exists(dbPath))
            {
                Directory.GetFiles(dbPath).ToList().ForEach(File.Delete);
            }

            _nodeFactory      = new NodeFactory();
            _discoveryStorage = new DiscoveryStorage(_configurationProvider, _nodeFactory, logManager, new PerfService(logManager));
        }