Commit f25559cb authored by Francis Dupont's avatar Francis Dupont

[712-cb_cmds-add-support-for-server-tags-in-the-shared-networks] Updated CB...

[712-cb_cmds-add-support-for-server-tags-in-the-shared-networks] Updated CB API description and test utils
parent 9e19304d
......@@ -185,7 +185,7 @@ public:
/// @brief Retrieves single option definition by code and space.
///
/// Allowed server selectors: ALL, ONE.
/// Not allowed server selector: ANY, UNASSIGNED, MULTIPLE.
/// Not allowed server selectors: ANY, UNASSIGNED, MULTIPLE.
///
/// @param server_selector Server selector.
/// @param code Code of the option to be retrieved.
......@@ -223,7 +223,7 @@ public:
/// @brief Retrieves single option by code and space.
///
/// Allowed server selectors: ALL, ONE.
/// Not allowed server selector: ANY, UNASSIGNED, MULTIPLE.
/// Not allowed server selectors: ANY, UNASSIGNED, MULTIPLE.
///
/// @param server_selector Server selector.
/// @param code Option code.
......@@ -261,7 +261,7 @@ public:
/// @brief Retrieves global parameter value.
///
/// Allowed server selectors: ALL, ONE.
/// Not allowed server selector: ANY, UNASSIGNED, MULTIPLE.
/// Not allowed server selectors: ANY, UNASSIGNED, MULTIPLE.
///
/// @param selector Server selector.
/// @param name Name of the global parameter to be retrieved.
......@@ -503,7 +503,8 @@ public:
/// @param space Option space of the option to be deleted.
/// @return Number of deleted option definitions.
virtual uint64_t
deleteOptionDef4(const db::ServerSelector& server_selector, const uint16_t code,
deleteOptionDef4(const db::ServerSelector& server_selector,
const uint16_t code,
const std::string& space) = 0;
/// @brief Deletes all option definitions.
......@@ -526,7 +527,8 @@ public:
/// @param space Option space of the option to be deleted.
/// @return Number of deleted options.
virtual uint64_t
deleteOption4(const db::ServerSelector& server_selector, const uint16_t code,
deleteOption4(const db::ServerSelector& server_selector,
const uint16_t code,
const std::string& space) = 0;
/// @brief Deletes shared network level option.
......@@ -557,8 +559,10 @@ public:
/// @param space Option space of the deleted option.
/// @return Number of deleted options.
virtual uint64_t
deleteOption4(const db::ServerSelector& server_selector, const SubnetID& subnet_id,
const uint16_t code, const std::string& space) = 0;
deleteOption4(const db::ServerSelector& server_selector,
const SubnetID& subnet_id,
const uint16_t code,
const std::string& space) = 0;
/// @brief Deletes pool level option.
///
......
......@@ -186,7 +186,7 @@ public:
/// @brief Retrieves single option definition by code and space.
///
/// Allowed server selectors: ALL, ONE.
/// Not allowed server selector: ANY, UNASSIGNED, MULTIPLE.
/// Not allowed server selectors: ANY, UNASSIGNED, MULTIPLE.
///
/// @param server_selector Server selector.
/// @param code Code of the option to be retrieved.
......@@ -224,7 +224,7 @@ public:
/// @brief Retrieves single option by code and space.
///
/// Allowed server selectors: ALL, ONE.
/// Not allowed server selector: ANY, UNASSIGNED, MULTIPLE.
/// Not allowed server selectors: ANY, UNASSIGNED, MULTIPLE.
///
/// @param server_selector Server selector.
/// @param code Option code.
......@@ -496,7 +496,7 @@ public:
///
/// @param server_selector Server selector.
/// @param name Name of the shared network to be deleted.
/// @return Number of deleted shared networks..
/// @return Number of deleted shared networks.
virtual uint64_t
deleteSharedNetwork6(const db::ServerSelector& server_selector,
const std::string& name) = 0;
......@@ -521,7 +521,8 @@ public:
/// @param space Option space of the option to be deleted.
/// @return Number of deleted option definitions.
virtual uint64_t
deleteOptionDef6(const db::ServerSelector& server_selector, const uint16_t code,
deleteOptionDef6(const db::ServerSelector& server_selector,
const uint16_t code,
const std::string& space) = 0;
/// @brief Deletes all option definitions.
......@@ -544,7 +545,8 @@ public:
/// @param space Option space of the option to be deleted.
/// @return Number of deleted options.
virtual uint64_t
deleteOption6(const db::ServerSelector& server_selector, const uint16_t code,
deleteOption6(const db::ServerSelector& server_selector,
const uint16_t code,
const std::string& space) = 0;
/// @brief Deletes shared network level option.
......@@ -572,8 +574,10 @@ public:
/// @param space Option space of the deleted option.
/// @return Number of deleted options.
virtual uint64_t
deleteOption6(const db::ServerSelector& server_selector, const SubnetID& subnet_id,
const uint16_t code, const std::string& space) = 0;
deleteOption6(const db::ServerSelector& server_selector,
const SubnetID& subnet_id,
const uint16_t code,
const std::string& space) = 0;
/// @brief Deletes pool level option.
///
......
......@@ -89,22 +89,6 @@ public:
return ("");
}
/// @brief Copy server tags between two stamped elements.
///
/// @param src Pointer to stamped element to copy tags from.
/// @param dst Pointer to stamped element to copy tags to.
void copyServerTags(const StampedElementPtr& src,
const StampedElementPtr& dst) const {
auto tags = src->getServerTags();
for (auto tag : tags) {
// Until the stamped element tags are in a set (vs a vector)
// we have to avoid duplicates.
if (!dst->hasServerTag(tag)) {
dst->setServerTag(tag.get());
}
}
}
/// @brief Merge server tags for a stamped element and a server selector.
///
/// @param elem Stamped element to update.
......@@ -113,11 +97,7 @@ public:
const db::ServerSelector& server_selector) const {
auto tags = server_selector.getTags();
for (auto tag : tags) {
// Until the stamped element tags are in a set (vs a vector)
// we have to avoid duplicates.
if (!elem->hasServerTag(tag)) {
elem->setServerTag(tag.get());
}
elem->setServerTag(tag.get());
}
}
......
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