ndn::nfd::Controller Class Reference

NFD Management protocol client. More...

#include <controller.hpp>

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

Public Types

typedef function< void(const ControlResponse &)> CommandFailCallback
 a callback on command failure More...
 
typedef function< void(const ControlParameters &)> CommandSucceedCallback
 a callback on command success More...
 
typedef function< void(uint32_t code, const std::string &reason)> DatasetFailCallback
 a callback on dataset retrieval failure More...
 

Public Member Functions

 Controller (Face &face, KeyChain &keyChain, security::v2::Validator &validator=security::getAcceptAllValidator())
 construct a Controller that uses face for transport, and uses the passed KeyChain to sign commands More...
 
template<typename Dataset >
std::enable_if< std::is_default_constructible< Dataset >::value >::type fetch (const std::function< void(typename Dataset::ResultType)> &onSuccess, const DatasetFailCallback &onFailure, const CommandOptions &options=CommandOptions())
 start dataset fetching More...
 
template<typename Dataset , typename ParamType = typename Dataset::ParamType>
void fetch (const ParamType &param, const std::function< void(typename Dataset::ResultType)> &onSuccess, const DatasetFailCallback &onFailure, const CommandOptions &options=CommandOptions())
 start dataset fetching More...
 
template<typename Command >
void start (const ControlParameters &parameters, const CommandSucceedCallback &onSuccess, const CommandFailCallback &onFailure, const CommandOptions &options=CommandOptions())
 start command execution More...
 

Static Public Attributes

static const uint32_t ERROR_LBOUND = 400
 inclusive lower bound of error codes More...
 
static const uint32_t ERROR_NACK = 10800
 error code for network Nack More...
 
static const uint32_t ERROR_SERVER = 500
 error code for server error More...
 
static const uint32_t ERROR_TIMEOUT = 10060
 error code for timeout More...
 
static const uint32_t ERROR_VALIDATION = 10021
 error code for response validation failure More...
 

Protected Attributes

Facem_face
 
KeyChain & m_keyChain
 
security::CommandInterestSigner m_signer
 
security::v2::Validatorm_validator
 

Detailed Description

NFD Management protocol client.

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

Definition at line 50 of file controller.hpp.

Member Typedef Documentation

a callback on command failure

Definition at line 59 of file controller.hpp.

a callback on command success

Definition at line 55 of file controller.hpp.

typedef function<void(uint32_t code, const std::string& reason)> ndn::nfd::Controller::DatasetFailCallback

a callback on dataset retrieval failure

Definition at line 63 of file controller.hpp.

Constructor & Destructor Documentation

ndn::nfd::Controller::Controller ( Face face,
KeyChain &  keyChain,
security::v2::Validator validator = security::getAcceptAllValidator() 
)

construct a Controller that uses face for transport, and uses the passed KeyChain to sign commands

Definition at line 41 of file controller.cpp.

Member Function Documentation

template<typename Dataset >
std::enable_if<std::is_default_constructible<Dataset>::value>::type ndn::nfd::Controller::fetch ( const std::function< void(typename Dataset::ResultType)> &  onSuccess,
const DatasetFailCallback onFailure,
const CommandOptions options = CommandOptions() 
)
inline

start dataset fetching

Definition at line 87 of file controller.hpp.

template<typename Dataset , typename ParamType = typename Dataset::ParamType>
void ndn::nfd::Controller::fetch ( const ParamType &  param,
const std::function< void(typename Dataset::ResultType)> &  onSuccess,
const DatasetFailCallback onFailure,
const CommandOptions options = CommandOptions() 
)
inline

start dataset fetching

Definition at line 98 of file controller.hpp.

template<typename Command >
void ndn::nfd::Controller::start ( const ControlParameters parameters,
const CommandSucceedCallback onSuccess,
const CommandFailCallback onFailure,
const CommandOptions options = CommandOptions() 
)
inline

start command execution

Definition at line 74 of file controller.hpp.

Member Data Documentation

const uint32_t ndn::nfd::Controller::ERROR_LBOUND = 400
static

inclusive lower bound of error codes

Definition at line 168 of file controller.hpp.

const uint32_t ndn::nfd::Controller::ERROR_NACK = 10800
static

error code for network Nack

Definition at line 156 of file controller.hpp.

const uint32_t ndn::nfd::Controller::ERROR_SERVER = 500
static

error code for server error

Definition at line 164 of file controller.hpp.

const uint32_t ndn::nfd::Controller::ERROR_TIMEOUT = 10060
static

error code for timeout

Definition at line 152 of file controller.hpp.

const uint32_t ndn::nfd::Controller::ERROR_VALIDATION = 10021
static

error code for response validation failure

Definition at line 160 of file controller.hpp.

Face& ndn::nfd::Controller::m_face
protected

Definition at line 171 of file controller.hpp.

KeyChain& ndn::nfd::Controller::m_keyChain
protected

Definition at line 172 of file controller.hpp.

security::CommandInterestSigner ndn::nfd::Controller::m_signer
protected

Definition at line 174 of file controller.hpp.

security::v2::Validator& ndn::nfd::Controller::m_validator
protected

Definition at line 173 of file controller.hpp.