Commit df9a8f92 authored by Naoki Kambe's avatar Naoki Kambe
Browse files

[trac930] add the helper functions which are used around the registration of...

[trac930] add the helper functions which are used around the registration of the function to validate the statistics data.
parent e9562533
......@@ -125,6 +125,10 @@ public:
/// The TSIG keyring
const shared_ptr<TSIGKeyRing>* keyring_;
/// Bind the ModuleSpec object in config_session_ with
/// isc:config::ModuleSpec::validateStatistics.
void registerStatisticsValidator();
private:
std::string db_file_;
......@@ -139,6 +143,9 @@ private:
/// Increment query counter
void incCounter(const int protocol);
// validateStatistics
bool validateStatistics(isc::data::ConstElementPtr data) const;
};
AuthSrvImpl::AuthSrvImpl(const bool use_cache,
......@@ -317,6 +324,7 @@ AuthSrv::setXfrinSession(AbstractSession* xfrin_session) {
void
AuthSrv::setConfigSession(ModuleCCSession* config_session) {
impl_->config_session_ = config_session;
impl_->registerStatisticsValidator();
}
void
......@@ -670,6 +678,22 @@ AuthSrvImpl::incCounter(const int protocol) {
}
}
void
AuthSrvImpl::registerStatisticsValidator() {
counters_.registerStatisticsValidator(
boost::bind(&AuthSrvImpl::validateStatistics, this, _1));
}
bool
AuthSrvImpl::validateStatistics(isc::data::ConstElementPtr data) const {
if (config_session_ == NULL) {
return (false);
}
return (
config_session_->getModuleSpec().validateStatistics(
data, true));
}
ConstElementPtr
AuthSrvImpl::setDbFile(ConstElementPtr config) {
ConstElementPtr answer = isc::config::createAnswer();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment