/* */ #include "Notifier.h" #include "RequestGroup.h" #include "WebSocketSessionMan.h" #include "LogFactory.h" namespace aria2 { Notifier::Notifier(const SharedHandle& wsSessionMan) : wsSessionMan_(wsSessionMan) {} Notifier::~Notifier() {} void Notifier::addWebSocketSession (const SharedHandle& wsSession) { A2_LOG_DEBUG("WebSocket session added."); wsSessionMan_->addSession(wsSession); } void Notifier::removeWebSocketSession (const SharedHandle& wsSession) { A2_LOG_DEBUG("WebSocket session removed."); wsSessionMan_->removeSession(wsSession); } const std::string Notifier::ON_DOWNLOAD_START = "aria2.onDownloadStart"; const std::string Notifier::ON_DOWNLOAD_PAUSE = "aria2.onDownloadPause"; const std::string Notifier::ON_DOWNLOAD_STOP = "aria2.onDownloadStop"; const std::string Notifier::ON_DOWNLOAD_COMPLETE = "aria2.onDownloadComplete"; const std::string Notifier::ON_DOWNLOAD_ERROR = "aria2.onDownloadError"; const std::string Notifier::ON_BT_DOWNLOAD_COMPLETE = "aria2.onBtDownloadComplete"; void Notifier::notifyDownloadEvent (const std::string& event, const RequestGroup* group) { if(wsSessionMan_) { wsSessionMan_->addNotification(event, group); } } } // namespace aria2