/* */ #include "RpcMethodFactory.h" #include "RpcMethodImpl.h" #include "OptionParser.h" #include "OptionHandler.h" namespace aria2 { namespace rpc { SharedHandle RpcMethodFactory::create(const std::string& methodName) { if(methodName == AddUriRpcMethod::getMethodName()) { return SharedHandle(new AddUriRpcMethod()); #ifdef ENABLE_BITTORRENT } else if(methodName == AddTorrentRpcMethod::getMethodName()) { return SharedHandle(new AddTorrentRpcMethod()); #endif // ENABLE_BITTORRENT #ifdef ENABLE_METALINK } else if(methodName == AddMetalinkRpcMethod::getMethodName()) { return SharedHandle(new AddMetalinkRpcMethod()); #endif // ENABLE_METALINK } else if(methodName == RemoveRpcMethod::getMethodName()) { return SharedHandle(new RemoveRpcMethod()); } else if(methodName == PauseRpcMethod::getMethodName()) { return SharedHandle(new PauseRpcMethod()); } else if(methodName == ForcePauseRpcMethod::getMethodName()) { return SharedHandle(new ForcePauseRpcMethod()); } else if(methodName == PauseAllRpcMethod::getMethodName()) { return SharedHandle(new PauseAllRpcMethod()); } else if(methodName == ForcePauseAllRpcMethod::getMethodName()) { return SharedHandle(new ForcePauseAllRpcMethod()); } else if(methodName == UnpauseRpcMethod::getMethodName()) { return SharedHandle(new UnpauseRpcMethod()); } else if(methodName == UnpauseAllRpcMethod::getMethodName()) { return SharedHandle(new UnpauseAllRpcMethod()); } else if(methodName == ForceRemoveRpcMethod::getMethodName()) { return SharedHandle(new ForceRemoveRpcMethod()); } else if(methodName == ChangePositionRpcMethod::getMethodName()) { return SharedHandle(new ChangePositionRpcMethod()); } else if(methodName == TellStatusRpcMethod::getMethodName()) { return SharedHandle(new TellStatusRpcMethod()); } else if(methodName == GetUrisRpcMethod::getMethodName()) { return SharedHandle(new GetUrisRpcMethod()); } else if(methodName == GetFilesRpcMethod::getMethodName()) { return SharedHandle(new GetFilesRpcMethod()); #ifdef ENABLE_BITTORRENT } else if(methodName == GetPeersRpcMethod::getMethodName()) { return SharedHandle(new GetPeersRpcMethod()); #endif // ENABLE_BITTORRENT } else if(methodName == GetServersRpcMethod::getMethodName()) { return SharedHandle(new GetServersRpcMethod()); } else if(methodName == TellActiveRpcMethod::getMethodName()) { return SharedHandle(new TellActiveRpcMethod()); } else if(methodName == TellWaitingRpcMethod::getMethodName()) { return SharedHandle(new TellWaitingRpcMethod()); } else if(methodName == TellStoppedRpcMethod::getMethodName()) { return SharedHandle(new TellStoppedRpcMethod()); } else if(methodName == GetOptionRpcMethod::getMethodName()) { return SharedHandle(new GetOptionRpcMethod()); } else if(methodName == ChangeUriRpcMethod::getMethodName()) { return SharedHandle(new ChangeUriRpcMethod()); } else if(methodName == ChangeOptionRpcMethod::getMethodName()) { return SharedHandle(new ChangeOptionRpcMethod()); } else if(methodName == GetGlobalOptionRpcMethod::getMethodName()) { return SharedHandle(new GetGlobalOptionRpcMethod()); } else if(methodName == ChangeGlobalOptionRpcMethod::getMethodName()) { return SharedHandle(new ChangeGlobalOptionRpcMethod()); } else if(methodName == PurgeDownloadResultRpcMethod::getMethodName()) { return SharedHandle(new PurgeDownloadResultRpcMethod()); } else if(methodName == RemoveDownloadResultRpcMethod::getMethodName()) { return SharedHandle(new RemoveDownloadResultRpcMethod()); } else if(methodName == GetVersionRpcMethod::getMethodName()) { return SharedHandle(new GetVersionRpcMethod()); } else if(methodName == GetSessionInfoRpcMethod::getMethodName()) { return SharedHandle(new GetSessionInfoRpcMethod()); } else if(methodName == ShutdownRpcMethod::getMethodName()) { return SharedHandle(new ShutdownRpcMethod()); } else if(methodName == ForceShutdownRpcMethod::getMethodName()) { return SharedHandle(new ForceShutdownRpcMethod()); } else if(methodName == SystemMulticallRpcMethod::getMethodName()) { return SharedHandle(new SystemMulticallRpcMethod()); } else { return SharedHandle(new NoSuchMethodRpcMethod()); } } } // namespace rpc } // namespace aria2