ndn::nfd::ControlCommand Class Reference

Base class of NFD ControlCommand. More...

#include <ndn-cxx/mgmt/nfd/control-command.hpp>

+ Inheritance diagram for ndn::nfd::ControlCommand:
+ Collaboration diagram for ndn::nfd::ControlCommand:

Classes

class  ArgumentError
 Represents an error in ControlParameters. More...
 
class  FieldValidator
 

Public Member Functions

virtual ~ControlCommand ()
 
virtual void applyDefaultsToRequest (ControlParameters &parameters) const
 Apply default values to missing fields in request. More...
 
virtual void applyDefaultsToResponse (ControlParameters &parameters) const
 Apply default values to missing fields in response. More...
 
Name getRequestName (const Name &commandPrefix, const ControlParameters &parameters) const
 Construct the Name for a request Interest. More...
 
virtual void validateRequest (const ControlParameters &parameters) const
 Validate request parameters. More...
 
virtual void validateResponse (const ControlParameters &parameters) const
 Validate response parameters. More...
 

Protected Member Functions

 ControlCommand (const std::string &module, const std::string &verb)
 

Protected Attributes

FieldValidator m_requestValidator
 FieldValidator for request ControlParameters. More...
 
FieldValidator m_responseValidator
 FieldValidator for response ControlParameters. More...
 

Detailed Description

Base class of NFD ControlCommand.

See also
https://redmine.named-data.net/projects/nfd/wiki/ControlCommand

Definition at line 35 of file control-command.hpp.

Constructor & Destructor Documentation

◆ ~ControlCommand()

ndn::nfd::ControlCommand::~ControlCommand ( )
virtualdefault

◆ ControlCommand()

ndn::nfd::ControlCommand::ControlCommand ( const std::string &  module,
const std::string &  verb 
)
protected

Definition at line 27 of file control-command.cpp.

Member Function Documentation

◆ applyDefaultsToRequest()

void ndn::nfd::ControlCommand::applyDefaultsToRequest ( ControlParameters parameters) const
virtual

◆ applyDefaultsToResponse()

void ndn::nfd::ControlCommand::applyDefaultsToResponse ( ControlParameters parameters) const
virtual

Apply default values to missing fields in response.

Definition at line 53 of file control-command.cpp.

◆ getRequestName()

Name ndn::nfd::ControlCommand::getRequestName ( const Name commandPrefix,
const ControlParameters parameters 
) const

Construct the Name for a request Interest.

Exceptions
ArgumentErrorif parameters are invalid

Definition at line 58 of file control-command.cpp.

◆ validateRequest()

void ndn::nfd::ControlCommand::validateRequest ( const ControlParameters parameters) const
virtual

Validate request parameters.

Exceptions
ArgumentErrorif parameters are invalid

Reimplemented in ndn::nfd::StrategyChoiceUnsetCommand, ndn::nfd::CsEraseCommand, and ndn::nfd::FaceDestroyCommand.

Definition at line 36 of file control-command.cpp.

◆ validateResponse()

void ndn::nfd::ControlCommand::validateResponse ( const ControlParameters parameters) const
virtual

Member Data Documentation

◆ m_requestValidator

FieldValidator ndn::nfd::ControlCommand::m_requestValidator
protected

FieldValidator for request ControlParameters.

Constructor of subclass should populate this validator.

Definition at line 120 of file control-command.hpp.

◆ m_responseValidator

FieldValidator ndn::nfd::ControlCommand::m_responseValidator
protected

FieldValidator for response ControlParameters.

Constructor of subclass should populate this validator.

Definition at line 125 of file control-command.hpp.