本文整理汇总了C++中plugin::queryrequestmessage::Request::command方法的典型用法代码示例。如果您正苦于以下问题:C++ Request::command方法的具体用法?C++ Request::command怎么用?C++ Request::command使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类plugin::queryrequestmessage::Request
的用法示例。
在下文中一共展示了Request::command方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: query_fallback
void LUAScript::query_fallback(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, const Plugin::QueryRequestMessage &request_message) {
std::string response_buffer;
boost::optional<scripts::command_definition<lua::lua_traits> > cmd = scripts_->find_command(scripts::nscp::tags::query_tag, request.command());
if (!cmd) {
cmd = scripts_->find_command(scripts::nscp::tags::simple_query_tag, request.command());
if (!cmd)
return nscapi::protobuf::functions::set_response_bad(*response, "Failed to find command: " + request.command());
return lua_runtime_->on_query(request.command(), cmd->information, cmd->function, true, request, response, request_message);
}
return lua_runtime_->on_query(request.command(), cmd->information, cmd->function, false, request, response, request_message);
}
示例2: query_fallback
void NRPEClient::query_fallback(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, const Plugin::QueryRequestMessage &request_message) {
client::configuration config(nrpe_client::command_prefix,
boost::shared_ptr<nrpe_client::clp_handler_impl>(new nrpe_client::clp_handler_impl(boost::shared_ptr<socket_helpers::client::client_handler>(new client_handler()))),
boost::shared_ptr<nrpe_client::target_handler>(new nrpe_client::target_handler(targets)));
nrpe_client::setup(config, request_message.header());
commands.parse_query(nrpe_client::command_prefix, nrpe_client::default_command, request.command(), config, request, *response, request_message);
}
示例3: query_fallback
void CheckExternalScripts::query_fallback(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, const Plugin::QueryRequestMessage &) {
//nscapi::functions::decoded_simple_command_data data = nscapi::functions::parse_simple_query_request(char_command, request);
commands::optional_command_object command_def = commands_.find_object(request.command());
std::list<std::string> args;
for (int i=0;i<request.arguments_size();++i) {
args.push_back(request.arguments(i));
}
if (command_def) {
handle_command(*command_def, args, response);
return;
}
alias::optional_command_object alias_def = aliases_.find_object(request.command());
if (alias_def) {
handle_alias(*alias_def, args, response);
return;
}
NSC_LOG_ERROR_STD("No command or alias found matching: " + request.command());
nscapi::protobuf::functions::set_response_bad(*response, "No command or alias found matching: " + request.command());
}
示例4: query_fallback
void CheckExternalScripts::query_fallback(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, const Plugin::QueryRequestMessage &) {
if (!provider_) {
NSC_LOG_ERROR_STD("No provider found: " + request.command());
nscapi::protobuf::functions::set_response_bad(*response, "No command or alias found matching: " + request.command());
return;
}
commands::command_object_instance command_def = provider_->find_command(request.command());
std::list<std::string> args;
for (int i = 0; i < request.arguments_size(); ++i) {
args.push_back(request.arguments(i));
}
if (command_def) {
handle_command(*command_def, args, response);
return;
}
alias::command_object_instance alias_def = aliases_.find_object(request.command());
if (alias_def) {
handle_alias(*alias_def, args, response);
return;
}
NSC_LOG_ERROR_STD("No command or alias found matching: " + request.command());
nscapi::protobuf::functions::set_response_bad(*response, "No command or alias found matching: " + request.command());
}
示例5: query_fallback
void CheckMKClient::query_fallback(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, const Plugin::QueryRequestMessage &request_message) {
client::configuration config(command_prefix, boost::shared_ptr<clp_handler_impl>(new clp_handler_impl(this)), boost::shared_ptr<target_handler>(new target_handler(targets)));
setup(config, request_message.header());
commands.parse_query(command_prefix, default_command, request.command(), config, request, *response, request_message);
}
示例6: data
cli_helper(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, data_container &data)
: data(data)
, desc("Allowed options for " + request.command())
, request(request)
, response(response)
, show_all(false) {}
示例7: query_fallback
void SMTPClient::query_fallback(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response, const Plugin::QueryRequestMessage &request_message) {
client::configuration config(command_prefix);
setup(config, request_message.header());
commands.parse_query(command_prefix, default_command, request.command(), config, request, *response, request_message);
}
示例8: sample_raw_command
void SamplePluginSimple::sample_raw_command(const Plugin::QueryRequestMessage::Request &request, Plugin::QueryResponseMessage::Response *response) {
response->set_command(request.command());
response->set_message("Yaaay it works");
response->set_result(Plugin::Common_ResultCode_OK);
}