Commit 7cf7ec75 authored by Naoki Kambe's avatar Naoki Kambe
Browse files

[trac929]

add some methods for statistics specification
 - getStatisticsSpec()
 - validateStatistics()
 - validateStatistics()

update the year of copyright
parent d5ded106
// Copyright (C) 2010 Internet Systems Consortium.
// Copyright (C) 2010, 2011 Internet Systems Consortium.
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
......@@ -71,6 +71,12 @@ namespace isc { namespace config {
/// part of the specification
isc::data::ConstElementPtr getConfigSpec() const;
/// Returns the statistics part of the specification as an
/// ElementPtr
/// \return ElementPtr Shared pointer to the statistics
/// part of the specification
isc::data::ConstElementPtr getStatisticsSpec() const;
/// Returns the full module specification as an ElementPtr
/// \return ElementPtr Shared pointer to the specification
isc::data::ConstElementPtr getFullSpec() const {
......@@ -95,6 +101,17 @@ namespace isc { namespace config {
bool validateConfig(isc::data::ConstElementPtr data,
const bool full = false) const;
// returns true if the given element conforms to this data
// statistics specification
/// Validates the given statistics data for this specification.
/// \param data The base \c Element of the data to check
/// \param full If true, all non-optional statistics parameters
/// must be specified.
/// \return true if the data conforms to the specification,
/// false otherwise.
bool validateStatistics(isc::data::ConstElementPtr data,
const bool full = false) const;
/// Validates the arguments for the given command
///
/// This checks the command and argument against the
......@@ -142,6 +159,10 @@ namespace isc { namespace config {
bool validateConfig(isc::data::ConstElementPtr data, const bool full,
isc::data::ElementPtr errors) const;
/// errors must be of type ListElement
bool validateStatistics(isc::data::ConstElementPtr data, const bool full,
isc::data::ElementPtr errors) const;
private:
bool validateItem(isc::data::ConstElementPtr spec,
isc::data::ConstElementPtr data,
......
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