summaryrefslogtreecommitdiffstats
path: root/src/hooks/dhcp/mysql_cb/mysql_cb_impl.h
diff options
context:
space:
mode:
authorMarcin Siodelski <marcin@isc.org>2019-06-28 15:58:26 +0200
committerFrancis Dupont <fdupont@isc.org>2019-06-30 14:35:44 +0200
commit835aeee9b1b6f6ef0e721a19462cfe52ae5766c9 (patch)
tree0d7459f2a4708c85d4f7ec4fdf8b95c9a83081bb /src/hooks/dhcp/mysql_cb/mysql_cb_impl.h
parent[#651,!384] Updated ChangeLog entry (diff)
downloadkea-835aeee9b1b6f6ef0e721a19462cfe52ae5766c9.tar.xz
kea-835aeee9b1b6f6ef0e721a19462cfe52ae5766c9.zip
[#676] Modified internal representation of the tags in ServerSelector.
Diffstat (limited to 'src/hooks/dhcp/mysql_cb/mysql_cb_impl.h')
-rw-r--r--src/hooks/dhcp/mysql_cb/mysql_cb_impl.h27
1 files changed, 4 insertions, 23 deletions
diff --git a/src/hooks/dhcp/mysql_cb/mysql_cb_impl.h b/src/hooks/dhcp/mysql_cb/mysql_cb_impl.h
index 456ee26d4d..f37d9de104 100644
--- a/src/hooks/dhcp/mysql_cb/mysql_cb_impl.h
+++ b/src/hooks/dhcp/mysql_cb/mysql_cb_impl.h
@@ -164,25 +164,6 @@ public:
const db::MySqlBindingPtr& min_binding,
const db::MySqlBindingPtr& max_binding);
- /// @brief Returns server tags associated with the particular selector.
- ///
- /// @param server_selector Server selector.
- /// @return Set of server tags.
- std::set<std::string> getServerTags(const db::ServerSelector& server_selector) const {
- std::set<std::string> tags;
- switch (server_selector.getType()) {
- case db::ServerSelector::Type::ALL:
- tags.insert("all");
- return (tags);
-
- default:
- return (server_selector.getTags());
- }
-
- // Unassigned server case.
- return (tags);
- }
-
/// @brief Returns server tag associated with the particular selector.
///
/// This method expects that there is exactly one server tag associated with
@@ -196,14 +177,14 @@ public:
/// is more than one server tag associated with the selector.
std::string getServerTag(const db::ServerSelector& server_selector,
const std::string& operation) const {
- auto tags = getServerTags(server_selector);
+ auto tags = server_selector.getTags();
if (tags.size() != 1) {
isc_throw(InvalidOperation, "expected exactly one server tag to be specified"
" while " << operation << ". Got: "
<< getServerTagsAsText(server_selector));
}
- return (*tags.begin());
+ return (tags.begin()->get());
}
/// @brief Returns server tags associated with the particular selector
@@ -212,12 +193,12 @@ public:
/// This method is useful for logging purposes.
std::string getServerTagsAsText(const db::ServerSelector& server_selector) const {
std::ostringstream s;
- auto server_tags = getServerTags(server_selector);
+ auto server_tags = server_selector.getTags();
for (auto tag : server_tags) {
if (s.tellp() != 0) {
s << ", ";
}
- s << tag;
+ s << tag.get();
}
return (s.str());