Ejemplo n.º 1
0
        public AddTorrentHandler(ISession session,
                                 IKeyValueStore keyValueStore,
                                 ITorrentMetadataRepository metadataRepository,
                                 ITorrentInfoRepository torrentInfoRepository)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (keyValueStore == null)
            {
                throw new ArgumentNullException("keyValueStore");
            }
            if (metadataRepository == null)
            {
                throw new ArgumentNullException("metadataRepository");
            }
            if (torrentInfoRepository == null)
            {
                throw new ArgumentNullException("torrentInfoRepository");
            }

            _session               = session;
            _keyValueStore         = keyValueStore;
            _metadataRepository    = metadataRepository;
            _torrentInfoRepository = torrentInfoRepository;
        }
Ejemplo n.º 2
0
        public SessionHandler(ILogger<SessionHandler> logger,
            IEnvironment environment,
            IFileSystem fileSystem,
            IKeyValueStore keyValueStore,
            IMessageBus messageBus,
            ISession session,
            ITorrentInfoRepository torrentInfoRepository,
            ITorrentMetadataRepository metadataRepository)
        {
            if (logger == null) throw new ArgumentNullException("logger");
            if (environment == null) throw new ArgumentNullException("environment");
            if (fileSystem == null) throw new ArgumentNullException("fileSystem");
            if (keyValueStore == null) throw new ArgumentNullException("keyValueStore");
            if (messageBus == null) throw new ArgumentNullException("messageBus");
            if (session == null) throw new ArgumentNullException("session");
            if (torrentInfoRepository == null) throw new ArgumentNullException("torrentInfoRepository");
            if (metadataRepository == null) throw new ArgumentNullException("metadataRepository");

            _logger = logger;
            _environment = environment;
            _fileSystem = fileSystem;
            _keyValueStore = keyValueStore;
            _messageBus = messageBus;
            _session = session;
            _torrentInfoRepository = torrentInfoRepository;
            _metadataRepository = metadataRepository;
            _muted = new List<string>();
            _alertsThread = new Thread(ReadAlerts);
        }
Ejemplo n.º 3
0
        public SessionHandler(ILogger <SessionHandler> logger,
                              IEnvironment environment,
                              IFileSystem fileSystem,
                              IKeyValueStore keyValueStore,
                              IMessageBus messageBus,
                              ISession session,
                              ITorrentInfoRepository torrentInfoRepository,
                              ITorrentMetadataRepository metadataRepository)
        {
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            if (environment == null)
            {
                throw new ArgumentNullException("environment");
            }
            if (fileSystem == null)
            {
                throw new ArgumentNullException("fileSystem");
            }
            if (keyValueStore == null)
            {
                throw new ArgumentNullException("keyValueStore");
            }
            if (messageBus == null)
            {
                throw new ArgumentNullException("messageBus");
            }
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (torrentInfoRepository == null)
            {
                throw new ArgumentNullException("torrentInfoRepository");
            }
            if (metadataRepository == null)
            {
                throw new ArgumentNullException("metadataRepository");
            }

            _logger                = logger;
            _environment           = environment;
            _fileSystem            = fileSystem;
            _keyValueStore         = keyValueStore;
            _messageBus            = messageBus;
            _session               = session;
            _torrentInfoRepository = torrentInfoRepository;
            _metadataRepository    = metadataRepository;
            _muted        = new List <string>();
            _alertsThread = new Thread(ReadAlerts);
        }