AccessibleWatcher::getInstance();
}
-::grpc::Status aurumServiceImpl::execute(Command* cmd)
+::grpc::Status aurumServiceImpl::execute(Command* cmd, bool clean)
{
std::unique_ptr<PreCommand> proxyPreCmd = std::make_unique<PreCommand>(cmd);
std::unique_ptr<PostCommand> proxyPostCmd = std::make_unique<PostCommand>(proxyPreCmd.get());
::grpc::Status rst = proxyPostCmd->execute();
- ObjectMapper::getInstance()->cleanUp();
+ if (clean) ObjectMapper::getInstance()->cleanUp();
return rst;
}
::aurum::RspEmpty* response)
{
std::unique_ptr<KillServerCommand> cmd = std::make_unique<KillServerCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::aurumServiceImpl::findElement(
::aurum::RspFindElement* response)
{
std::unique_ptr<FindElementCommand> cmd = std::make_unique<FindElementCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), true);
}
::grpc::Status aurumServiceImpl::aurumServiceImpl::click(
::aurum::RspClick* response)
{
std::unique_ptr<ClickCommand> cmd = ClickCommand::createCommand(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), true);
}
::grpc::Status aurumServiceImpl::getValue(::grpc::ServerContext* context,
::aurum::RspGetValue* response)
{
std::unique_ptr<GetValueCommand> cmd = std::make_unique<GetValueCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), true);
}
::grpc::Status aurumServiceImpl::setValue(::grpc::ServerContext* context,
::aurum::RspSetValue* response)
{
std::unique_ptr<SetValueCommand> cmd = std::make_unique<SetValueCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), true);
}
::grpc::Status aurumServiceImpl::getAttribute(
::aurum::RspGetAttribute* response)
{
std::unique_ptr<GetAttributeCommand> cmd = GetAttributeCommand::createCommand(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), true);
}
::grpc::Status aurumServiceImpl::getSize(::grpc::ServerContext* context,
::aurum::RspGetSize* response)
{
std::unique_ptr<GetSizeCommand> cmd = std::make_unique<GetSizeCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), true);
}
::grpc::Status aurumServiceImpl::clear(::grpc::ServerContext* context,
::aurum::RspClear* response)
{
std::unique_ptr<ClearCommand> cmd = std::make_unique<ClearCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), true);
}
::grpc::Status aurumServiceImpl::installApp(
::aurum::RspInstallApp* response)
{
std::unique_ptr<InstallAppCommand> cmd = std::make_unique<InstallAppCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::removeApp(::grpc::ServerContext* context,
::aurum::RspRemoveApp* response)
{
std::unique_ptr<RemoveAppCommand> cmd = std::make_unique<RemoveAppCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::getAppInfo(
::aurum::RspGetAppInfo* response)
{
std::unique_ptr<GetAppInfoCommand> cmd = std::make_unique<GetAppInfoCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::launchApp(::grpc::ServerContext* context,
::aurum::RspLaunchApp* response)
{
std::unique_ptr<LaunchAppCommand> cmd = std::make_unique<LaunchAppCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::closeApp(::grpc::ServerContext* context,
::aurum::RspCloseApp* response)
{
std::unique_ptr<CloseAppCommand> cmd = std::make_unique<CloseAppCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::touchDown(::grpc::ServerContext* context,
::aurum::RspTouchDown* response)
{
std::unique_ptr<TouchDownCommand> cmd = std::make_unique<TouchDownCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::touchUp(::grpc::ServerContext* context,
::aurum::RspTouchUp* response)
{
std::unique_ptr<TouchUpCommand> cmd = std::make_unique<TouchUpCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::touchMove(::grpc::ServerContext* context,
::aurum::RspTouchMove* response)
{
std::unique_ptr<TouchMoveCommand> cmd = std::make_unique<TouchMoveCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::longClick(::grpc::ServerContext* context,
::aurum::RspClick* response)
{
std::unique_ptr<LongClickCommand> cmd = std::make_unique<LongClickCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::flick(::grpc::ServerContext* context,
::aurum::RspFlick* response)
{
std::unique_ptr<FlickCommand> cmd = std::make_unique<FlickCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::getDeviceTime(
::aurum::RspGetDeviceTime* response)
{
std::unique_ptr<GetDeviceTimeCommand> cmd = std::make_unique<GetDeviceTimeCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::getLocation(
::aurum::RspGetLocation* response)
{
std::unique_ptr<GetLocationCommand> cmd = std::make_unique<GetLocationCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::sendKey(::grpc::ServerContext* context,
::aurum::RspKey* response)
{
std::unique_ptr<SendKeyCommand> cmd = std::make_unique<SendKeyCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::takeScreenshot(::grpc::ServerContext* context,
::grpc::ServerWriter< ::aurum::RspTakeScreenshot>* writer)
{
std::unique_ptr<TakeScreenshotCommand> cmd = std::make_unique<TakeScreenshotCommand>(request, writer);
- return execute(cmd.get());
+ return execute(cmd.get(), false);
}
::grpc::Status aurumServiceImpl::dumpObjectTree(::grpc::ServerContext *context,
::aurum::RspDumpObjectTree * response)
{
std::unique_ptr<DumpObjectTreeCommand> cmd = std::make_unique<DumpObjectTreeCommand>(request, response);
- return execute(cmd.get());
+ return execute(cmd.get(), true);
}