nfd::ManagerBase Class Reference

A collection of common functions shared by all NFD managers, such as communicating with the dispatcher and command validator. More...

#include <daemon/mgmt/manager-base.hpp>

+ Inheritance diagram for nfd::ManagerBase:
+ Collaboration diagram for nfd::ManagerBase:

Classes

class  Error
 

Public Member Functions

const std::string & getModule () const
 

Protected Types

using ControlCommandHandler = std::function< void(const ControlCommand &command, const Name &prefix, const Interest &interest, const ControlParameters &parameters, const ndn::mgmt::CommandContinuation done)>
 

Protected Member Functions

 ManagerBase (std::string_view module, Dispatcher &dispatcher)
 
 ManagerBase (std::string_view module, Dispatcher &dispatcher, CommandAuthenticator &authenticator)
 
 ~ManagerBase ()
 
template<typename Command >
void registerCommandHandler (const std::string &verb, const ControlCommandHandler &handler)
 
ndn::mgmt::PostNotification registerNotificationStream (const std::string &verb)
 
void registerStatusDatasetHandler (const std::string &verb, const ndn::mgmt::StatusDatasetHandler &handler)
 

Static Protected Member Functions

static std::string extractSigner (const Interest &interest)
 Extracts the name from the KeyLocator of a ControlCommand request. More...
 

Detailed Description

A collection of common functions shared by all NFD managers, such as communicating with the dispatcher and command validator.

Definition at line 49 of file manager-base.hpp.

Member Typedef Documentation

◆ ControlCommandHandler

using nfd::ManagerBase::ControlCommandHandler = std::function<void(const ControlCommand& command, const Name& prefix, const Interest& interest, const ControlParameters& parameters, const ndn::mgmt::CommandContinuation done)>
protected

Definition at line 80 of file manager-base.hpp.

Constructor & Destructor Documentation

◆ ManagerBase() [1/2]

nfd::ManagerBase::ManagerBase ( std::string_view  module,
Dispatcher &  dispatcher 
)
protected
Warning
If you use this constructor, you MUST override makeAuthorization().

Definition at line 30 of file manager-base.cpp.

◆ ManagerBase() [2/2]

nfd::ManagerBase::ManagerBase ( std::string_view  module,
Dispatcher &  dispatcher,
CommandAuthenticator authenticator 
)
protected

Definition at line 36 of file manager-base.cpp.

◆ ~ManagerBase()

nfd::ManagerBase::~ManagerBase ( )
protecteddefault

Member Function Documentation

◆ extractSigner()

std::string nfd::ManagerBase::extractSigner ( const Interest &  interest)
staticprotected

Extracts the name from the KeyLocator of a ControlCommand request.

This is called after the signature has been validated. Returns an empty string if SignatureInfo or KeyLocator are missing or malformed.

Definition at line 62 of file manager-base.cpp.

◆ getModule()

const std::string& nfd::ManagerBase::getModule ( ) const
inline

Definition at line 59 of file manager-base.hpp.

◆ registerCommandHandler()

template<typename Command >
void nfd::ManagerBase::registerCommandHandler ( const std::string &  verb,
const ControlCommandHandler handler 
)
protected

Definition at line 154 of file manager-base.hpp.

◆ registerNotificationStream()

ndn::mgmt::PostNotification nfd::ManagerBase::registerNotificationStream ( const std::string &  verb)
protected

Definition at line 56 of file manager-base.cpp.

◆ registerStatusDatasetHandler()

void nfd::ManagerBase::registerStatusDatasetHandler ( const std::string &  verb,
const ndn::mgmt::StatusDatasetHandler &  handler 
)
protected

Definition at line 47 of file manager-base.cpp.