Ejemplo n.º 1
0
        public static MongoCollectionManager <QueueDownloadFile> CreateMongoQueueDownloadFileManager(XElement xe)
        {
            MongoCollectionManager <QueueDownloadFile> mongoQueueDownloadFileManager = MongoCollectionManager <QueueDownloadFile> .Create(xe.zXPathElement("MongoQueueDownloadFile_new"));

            mongoQueueDownloadFileManager.IdGenerator = new MongoIdGeneratorInt(mongoQueueDownloadFileManager.GetCollection());
            return(mongoQueueDownloadFileManager);
        }
Ejemplo n.º 2
0
        //public DownloadManager_v2 CreateDownloadManager_v2(bool useTestManager = false)
        public DownloadManager CreateDownloadManager()
        {
            MongoCollectionManager <DownloadedFile> mongoDownloadedFileManager = MongoCollectionManager <DownloadedFile> .Create(_xeConfig.zXPathElement("MongoDownloadedFile"));

            mongoDownloadedFileManager.IdGenerator = new MongoIdGeneratorInt(mongoDownloadedFileManager.GetCollection());
            mongoDownloadedFileManager.KeyName     = "Key"; // Key is the name of key field in DownloadedFile_v2

            //MongoCollectionManager<QueueDownloadFile> mongoQueueDownloadFileManager = MongoCollectionManager<QueueDownloadFile>.Create(_xeConfig.zXPathElement("MongoQueueDownloadFile_new"));
            //mongoQueueDownloadFileManager.IdGenerator = new MongoIdGeneratorInt(mongoQueueDownloadFileManager.GetCollection());
            //mongoDownloadedFileManager.KeyName = "Key";     // Key is the name of key field in QueueDownloadFile_v2
            MongoCollectionManager <QueueDownloadFile> mongoQueueDownloadFileManager = CreateMongoQueueDownloadFileManager(_xeConfig);

            MongoCollectionManager <DownloadLinkRef> mongoCurrentDownloadFileManager = MongoCollectionManager <DownloadLinkRef> .Create(_xeConfig.zXPathElement("MongoCurrentDownloadFile"));

            mongoCurrentDownloadFileManager.IdGenerator = new MongoIdGeneratorInt(mongoCurrentDownloadFileManager.GetCollection());

            ProtectLink protectLink = null;

            //Debrider debrider = null;
            //if (!_useTestManager)
            //    debrider = CreateDebrider();
            //else
            //    debrider = new DebriderAlldebridTest();
            Debrider debrider = CreateDebrider();
            DownloadManagerClientBase downloadManagerClient = CreateDownloadManagerClient();
            UncompressQueueManager    uncompressManager     = CreateUncompressManager();

            DownloadManager downloadManager = new DownloadManager();

            downloadManager.DownloadManagerClient           = downloadManagerClient;
            downloadManager.MongoDownloadedFileManager      = mongoDownloadedFileManager;
            downloadManager.MongoQueueDownloadFileManager   = mongoQueueDownloadFileManager;
            downloadManager.MongoCurrentDownloadFileManager = mongoCurrentDownloadFileManager;
            downloadManager.ProtectLink       = protectLink;
            downloadManager.Debrider          = debrider;
            downloadManager.UncompressManager = uncompressManager;
            return(downloadManager);
        }
Ejemplo n.º 3
0
 public void InitBackup(Backup backup)
 {
     backup.Add(dir => MongoBackup.Backup(_mongoDownloadedFileManager.GetCollection(), dir));
     backup.Add(dir => MongoBackup.Backup(_mongoQueueDownloadFileManager.GetCollection(), dir));
     backup.Add(dir => MongoBackup.Backup(_mongoCurrentDownloadFileManager.GetCollection(), dir));
 }