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

virtual ~ManagerBase ()
 
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 (const std::string &module, Dispatcher &dispatcher)
 
 ManagerBase (const std::string &module, Dispatcher &dispatcher, CommandAuthenticator &authenticator)
 
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 void extractRequester (const Interest &interest, const ndn::mgmt::AcceptContinuation &accept)
 Extracts the requester from 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 47 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 76 of file manager-base.hpp.

Constructor & Destructor Documentation

◆ ~ManagerBase()

nfd::ManagerBase::~ManagerBase ( )
virtualdefault

◆ ManagerBase() [1/2]

nfd::ManagerBase::ManagerBase ( const std::string &  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 ( const std::string &  module,
Dispatcher &  dispatcher,
CommandAuthenticator authenticator 
)
protected

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

Member Function Documentation

◆ extractRequester()

void nfd::ManagerBase::extractRequester ( const Interest &  interest,
const ndn::mgmt::AcceptContinuation &  accept 
)
staticprotected

Extracts the requester from a ControlCommand request.

This is called after the signature has been validated.

Parameters
interesta request for ControlCommand
acceptcallback of successful validation, takes the requester string as argument

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

◆ getModule()

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

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

◆ registerCommandHandler()

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

Definition at line 152 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.