Kea 1.5.0
config_ctl_info.h
Go to the documentation of this file.
1// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef PROCESS_CONFIG_CTL_INFO_H
8#define PROCESS_CONFIG_CTL_INFO_H
9
10#include <cc/cfg_to_element.h>
12
13#include <boost/shared_ptr.hpp>
14#include <stdint.h>
15#include <vector>
16
17namespace isc {
18namespace process {
19
24public:
27
37 void setAccessString(const std::string& access_str);
38
42 std::string getAccessString() const {
43 return (access_str_);
44 }
45
49 std::string redactedAccessString() const {
51 }
52
57 return (access_params_);
58 }
59
68 bool getParameterValue(const std::string& name,
69 std::string& value) const;
70
74 virtual isc::data::ElementPtr toElement() const;
75
81 bool equals(const ConfigDbInfo& other) const;
82
88 bool operator==(const ConfigDbInfo& other) const {
89 return (equals(other));
90 }
91
97 bool operator!=(const ConfigDbInfo& other) const {
98 return (!equals(other));
99 }
100
101private:
103 std::string access_str_;
104
107};
108
109typedef std::vector<ConfigDbInfo> ConfigDbInfoList;
110
139public:
140
143
146
153 void addConfigDatabase(const std::string& access_str);
154
162 return (db_infos_);
163 }
164
169 const ConfigDbInfo& findConfigDb(const std::string& param_name,
170 const std::string& param_value);
171
173 void clear();
174
178 virtual isc::data::ElementPtr toElement() const;
179
183 static const ConfigDbInfo& EMPTY_DB();
184
190 bool equals(const ConfigControlInfo& other) const;
191
192private:
193
195 ConfigDbInfoList db_infos_;
196};
197
199typedef boost::shared_ptr<ConfigControlInfo> ConfigControlInfoPtr;
201typedef boost::shared_ptr<const ConfigControlInfo> ConstConfigControlInfoPtr;
202
203} // namespace process
204} // end namespace isc
205
206#endif // PROCESS_CONFIG_CTL_INFO_H
static std::string redactedAccessString(const ParameterMap &parameters)
Redact database access string.
std::map< std::string, std::string > ParameterMap
Database configuration parameter map.
Embodies configuration information used during a server's configuration process.
const ConfigDbInfoList & getConfigDatabases() const
Retrieves the list of databases.
static const ConfigDbInfo & EMPTY_DB()
Fetches the not-found value returned by database list searches.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
void addConfigDatabase(const std::string &access_str)
Sets configuration database access string.
bool equals(const ConfigControlInfo &other) const
Compares two objects for equality.
const ConfigDbInfo & findConfigDb(const std::string &param_name, const std::string &param_value)
Retrieves the datbase with the given access parameter value.
void clear()
Empties the contents of the class, including the database list.
Provides configuration information used during a server's configuration process.
std::string getAccessString() const
Retrieves the database access string.
void setAccessString(const std::string &access_str)
Set the access string.
bool equals(const ConfigDbInfo &other) const
Compares two objects for equality.
bool getParameterValue(const std::string &name, std::string &value) const
Fetch the value of a given parmeter.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
const db::DatabaseConnection::ParameterMap & getParameters() const
Retrieve the map of parameter values.
bool operator!=(const ConfigDbInfo &other) const
Compares two objects for inequality.
bool operator==(const ConfigDbInfo &other) const
Compares two objects for equality.
std::string redactedAccessString() const
Retrieves the database access string with password redacted.
boost::shared_ptr< Element > ElementPtr
Definition: data.h:22
boost::shared_ptr< const ConfigControlInfo > ConstConfigControlInfoPtr
Defines a pointer to a const ConfigControlInfo.
std::vector< ConfigDbInfo > ConfigDbInfoList
boost::shared_ptr< ConfigControlInfo > ConfigControlInfoPtr
Defines a pointer to a ConfigControlInfo.
Defines the logger used by the top-level component of kea-dhcp-ddns.
Abstract class for configuration Cfg_* classes.