NFD Management protocol client. More...
#include <controller.hpp>
Public Types | |
typedef function< void(const ControlParameters &)> | CommandSucceedCallback |
a callback on command success More... | |
typedef function< void(const ControlResponse &)> | CommandFailCallback |
a callback on command failure 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, security::KeyChain &keyChain, security::Validator &validator=s_validatorNull) | |
construct a Controller that uses face for transport, and uses the passed KeyChain to sign commands More... | |
template<typename Command > | |
void | start (const ControlParameters ¶meters, const CommandSucceedCallback &onSuccess, const CommandFailCallback &onFailure, const CommandOptions &options=CommandOptions()) |
start command execution 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 ¶m, const std::function< void(typename Dataset::ResultType)> &onSuccess, const DatasetFailCallback &onFailure, const CommandOptions &options=CommandOptions()) |
start dataset fetching More... | |
Static Public Attributes | |
static const uint32_t | ERROR_TIMEOUT = 10060 |
error code for timeout More... | |
static const uint32_t | ERROR_NACK = 10800 |
error code for network Nack More... | |
static const uint32_t | ERROR_VALIDATION = 10021 |
error code for response validation failure More... | |
static const uint32_t | ERROR_SERVER = 500 |
error code for server error More... | |
static const uint32_t | ERROR_LBOUND = 400 |
inclusive lower bound of error codes More... | |
Protected Attributes | |
Face & | m_face |
security::KeyChain & | m_keyChain |
security::Validator & | m_validator |
NFD Management protocol client.
Definition at line 51 of file controller.hpp.
typedef function<void(const ControlParameters&)> ndn::nfd::Controller::CommandSucceedCallback |
a callback on command success
Definition at line 56 of file controller.hpp.
typedef function<void(const ControlResponse&)> ndn::nfd::Controller::CommandFailCallback |
a callback on command failure
Definition at line 60 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 64 of file controller.hpp.
ndn::nfd::Controller::Controller | ( | Face & | face, |
security::KeyChain & | keyChain, | ||
security::Validator & | validator = s_validatorNull |
||
) |
construct a Controller that uses face for transport, and uses the passed KeyChain to sign commands
Definition at line 39 of file controller.cpp.
References ndn::Block::blockFromValue(), ERROR_LBOUND, ERROR_NACK, ERROR_SERVER, ERROR_TIMEOUT, ERROR_VALIDATION, ndn::Face::expressInterest(), ndn::util::SegmentFetcher::fetch(), ndn::mgmt::ControlResponse::getBody(), ndn::mgmt::ControlResponse::getCode(), ndn::Data::getContent(), ndn::nfd::CommandOptions::getPrefix(), ndn::nfd::CommandOptions::getSigningInfo(), ndn::nfd::CommandOptions::getTimeout(), m_face, m_keyChain, m_validator, ndn::Interest::setInterestLifetime(), ndn::security::KeyChain::sign(), ndn::security::Validator::validate(), ndn::mgmt::ControlResponse::wireDecode(), and ndn::nfd::ControlParameters::wireDecode().
|
inline |
start command execution
Definition at line 75 of file controller.hpp.
Referenced by nfd::rib::FibUpdater::computeAndSendFibUpdates(), nfd::rib::AutoPrefixPropagator::disable(), nfd::rib::RibManager::enableLocalFields(), and nfd::rib::RibManager::onRibUpdateFailure().
|
inline |
start dataset fetching
Definition at line 88 of file controller.hpp.
Referenced by nfd::rib::RibManager::onRibUpdateFailure().
|
inline |
start dataset fetching
Definition at line 99 of file controller.hpp.
|
static |
error code for timeout
Definition at line 153 of file controller.hpp.
Referenced by nfd::rib::FibUpdater::computeAndSendFibUpdates(), and Controller().
|
static |
error code for network Nack
Definition at line 157 of file controller.hpp.
Referenced by Controller().
|
static |
error code for response validation failure
Definition at line 161 of file controller.hpp.
Referenced by Controller().
|
static |
error code for server error
Definition at line 165 of file controller.hpp.
Referenced by Controller().
|
static |
inclusive lower bound of error codes
Definition at line 169 of file controller.hpp.
Referenced by Controller().
|
protected |
Definition at line 172 of file controller.hpp.
Referenced by Controller().
|
protected |
Definition at line 173 of file controller.hpp.
Referenced by Controller().
|
protected |
Definition at line 174 of file controller.hpp.
Referenced by Controller().