Kea 1.5.0
isc::config::CmdsImpl Class Reference

Base class that command handler implementers may use for common tasks. More...

#include <cmds_impl.h>

+ Inheritance diagram for isc::config::CmdsImpl:

Protected Member Functions

void extractCommand (hooks::CalloutHandle &handle)
 Extracts the command name and arguments from a Callout handle.
 
void setErrorResponse (hooks::CalloutHandle &handle, const std::string &text, int status=CONTROL_RESULT_ERROR)
 Set the callout argument "response" to indicate an error.
 
void setResponse (hooks::CalloutHandle &handle, data::ConstElementPtr &response)
 Set the callout argument "response" to the given response.
 
void setSuccessResponse (hooks::CalloutHandle &handle, const std::string &text)
 Set the callout argument "response" to indicate success.
 

Protected Attributes

data::ConstElementPtr cmd_args_
 Stores the command arguments extracted by a call to extractCommand.
 
std::string cmd_name_
 Stores the command name extracted by a call to extractCommand.
 

Detailed Description

Base class that command handler implementers may use for common tasks.

Definition at line 21 of file cmds_impl.h.

Member Function Documentation

◆ extractCommand()

◆ setErrorResponse()

void isc::config::CmdsImpl::setErrorResponse ( hooks::CalloutHandle handle,
const std::string &  text,
int  status = CONTROL_RESULT_ERROR 
)
inlineprotected

◆ setResponse()

void isc::config::CmdsImpl::setResponse ( hooks::CalloutHandle handle,
data::ConstElementPtr response 
)
inlineprotected

Set the callout argument "response" to the given response.

Parameters
handleCallout context handle in which to set the "response" argument
responseElementPtr to a the result to use as the reponse

Definition at line 64 of file cmds_impl.h.

References isc::hooks::CalloutHandle::setArgument().

Referenced by isc::lease_cmds::LeaseCmdsImpl::lease4WipeHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6WipeHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetAllHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetPageHandler(), setErrorResponse(), setSuccessResponse(), isc::stat_cmds::LeaseStatCmdsImpl::statLease4GetHandler(), and isc::stat_cmds::LeaseStatCmdsImpl::statLease6GetHandler().

+ Here is the call graph for this function:

◆ setSuccessResponse()

void isc::config::CmdsImpl::setSuccessResponse ( hooks::CalloutHandle handle,
const std::string &  text 
)
inlineprotected

Set the callout argument "response" to indicate success.

Parameters
handleCallout context handle in which to set the "response" argument
textstring text to be used as the response description

Definition at line 43 of file cmds_impl.h.

References isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), and setResponse().

Referenced by isc::lease_cmds::LeaseCmdsImpl::lease4DelHandler(), isc::lease_cmds::LeaseCmdsImpl::lease4UpdateHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6DelHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6UpdateHandler(), and isc::lease_cmds::LeaseCmdsImpl::leaseAddHandler().

+ Here is the call graph for this function:

Member Data Documentation

◆ cmd_args_

◆ cmd_name_

std::string isc::config::CmdsImpl::cmd_name_
protected

The documentation for this class was generated from the following file: