/* */ #include "DHTBucketRefreshCommand.h" #include "DHTRoutingTable.h" #include "DHTTaskQueue.h" #include "DHTTaskFactory.h" #include "DHTTask.h" #include "DownloadEngine.h" #include "RequestGroupMan.h" #include "FileEntry.h" #include "ServerStatMan.h" #include "FileAllocationEntry.h" #include "CheckIntegrityEntry.h" namespace aria2 { DHTBucketRefreshCommand::DHTBucketRefreshCommand (cuid_t cuid, DownloadEngine* e, time_t interval): TimeBasedCommand(cuid, e, interval) {} DHTBucketRefreshCommand::~DHTBucketRefreshCommand() {} void DHTBucketRefreshCommand::preProcess() { if(getDownloadEngine()->getRequestGroupMan()->downloadFinished() || getDownloadEngine()->isHaltRequested()) { enableExit(); } } void DHTBucketRefreshCommand::process() { _taskQueue->addPeriodicTask1(_taskFactory->createBucketRefreshTask()); } void DHTBucketRefreshCommand::setRoutingTable (const SharedHandle& routingTable) { _routingTable = routingTable; } void DHTBucketRefreshCommand::setTaskQueue (const SharedHandle& taskQueue) { _taskQueue = taskQueue; } void DHTBucketRefreshCommand::setTaskFactory (const SharedHandle& taskFactory) { _taskFactory = taskFactory; } } // namespace aria2