Exemple #1
0
        public AddTorrentHandler(ISession session,
                                 IKeyValueStore keyValueStore,
                                 ITorrentMetadataRepository metadataRepository,
                                 ITorrentInfoSaver torrentInfoSaver)
        {
            if (session == null)
            {
                throw new ArgumentNullException("session");
            }
            if (keyValueStore == null)
            {
                throw new ArgumentNullException("keyValueStore");
            }
            if (metadataRepository == null)
            {
                throw new ArgumentNullException("metadataRepository");
            }
            if (torrentInfoSaver == null)
            {
                throw new ArgumentNullException("torrentInfoSaver");
            }

            _session            = session;
            _keyValueStore      = keyValueStore;
            _metadataRepository = metadataRepository;
            _torrentInfoSaver   = torrentInfoSaver;
        }
Exemple #2
0
        public SessionHandler(ILogger <SessionHandler> logger,
                              IEnvironment environment,
                              IFileSystem fileSystem,
                              IKeyValueStore keyValueStore,
                              IMessageBus messageBus,
                              ISession session,
                              ITorrentInfoSaver torrentInfoSaver,
                              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 (torrentInfoSaver == null)
            {
                throw new ArgumentNullException("torrentInfoSaver");
            }
            if (metadataRepository == null)
            {
                throw new ArgumentNullException("metadataRepository");
            }

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