summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_regular/src/sql_pt_representation.cc
diff options
context:
space:
mode:
authorAlexander Kutsan <akutsan@luxoft.com>2017-08-22 19:54:31 +0300
committerAlexander Kutsan <akutsan@luxoft.com>2017-08-22 19:54:31 +0300
commitbca7dd9f538fba067212d52e4ae94d6edd732be5 (patch)
treea1091bb4f1355b4cc99b9a36d8d12d3f3dd7875d /src/components/policy/policy_regular/src/sql_pt_representation.cc
parent124a811939df303f2f76ca1e289d8b22a12cd0e3 (diff)
downloadsdl_core-bca7dd9f538fba067212d52e4ae94d6edd732be5.tar.gz
Remove primary logic from sql queries
Diffstat (limited to 'src/components/policy/policy_regular/src/sql_pt_representation.cc')
-rw-r--r--src/components/policy/policy_regular/src/sql_pt_representation.cc56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/components/policy/policy_regular/src/sql_pt_representation.cc b/src/components/policy/policy_regular/src/sql_pt_representation.cc
index 06cbc03dfb..9f529b7d78 100644
--- a/src/components/policy/policy_regular/src/sql_pt_representation.cc
+++ b/src/components/policy/policy_regular/src/sql_pt_representation.cc
@@ -871,10 +871,6 @@ bool SQLPTRepresentation::SaveApplicationPoliciesSection(
return false;
}
#ifdef SDL_REMOTE_CONTROL
- if (!query_delete.Exec(sql_pt::kDeleteAppGroupPrimary)) {
- LOG4CXX_WARN(logger_, "Incorrect delete from app_group_primary.");
- return false;
- }
if (!query_delete.Exec(sql_pt::kDeleteModuleTypes)) {
LOG4CXX_WARN(logger_, "Incorrect delete from module_type.");
return false;
@@ -1534,20 +1530,6 @@ bool SQLPTRepresentation::GatherAppGroup(
}
#ifdef SDL_REMOTE_CONTROL
-bool SQLPTRepresentation::GatherAppGroupPrimary(
- const std::string& app_id, policy_table::Strings* app_groups) const {
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kSelectAppGroupsPrimary)) {
- LOG4CXX_WARN(logger_, "Incorrect select from app groups for primary RC");
- return false;
- }
-
- query.Bind(0, app_id);
- while (query.Next()) {
- app_groups->push_back(query.GetString(0));
- }
- return true;
-}
bool SQLPTRepresentation::GatherRemoteControlDenied(const std::string& app_id,
bool* denied) const {
@@ -1585,31 +1567,6 @@ bool SQLPTRepresentation::GatherModuleType(
return true;
}
-bool SQLPTRepresentation::SaveAppGroupPrimary(
- const std::string& app_id, const policy_table::Strings& app_groups) {
- LOG4CXX_AUTO_TRACE(logger_);
- utils::dbms::SQLQuery query(db());
- if (!query.Prepare(sql_pt::kInsertAppGroupPrimary)) {
- LOG4CXX_WARN(logger_, "Incorrect insert statement for app group primary");
- return false;
- }
- policy_table::Strings::const_iterator it;
- for (it = app_groups.begin(); it != app_groups.end(); ++it) {
- std::string ssss = *it;
- LOG4CXX_INFO(logger_, "Group: " << ssss);
- query.Bind(0, app_id);
- query.Bind(1, *it);
- if (!query.Exec() || !query.Reset()) {
- LOG4CXX_WARN(logger_,
- "Incorrect insert into app group primary."
- << query.LastError().text());
- return false;
- }
- }
-
- return true;
-}
-
bool SQLPTRepresentation::SaveRemoteControlDenied(const std::string& app_id,
bool deny) {
LOG4CXX_AUTO_TRACE(logger_);
@@ -1849,19 +1806,6 @@ bool SQLPTRepresentation::SetDefaultPolicy(const std::string& app_id) {
LOG4CXX_ERROR(logger_, "Failed deleting from app_group.");
return false;
}
-#ifdef SDL_REMOTE_CONTROL
- utils::dbms::SQLQuery query_p(db());
- if (!query_p.Prepare(sql_pt::kDeleteAppGroupPrimaryByApplicationId)) {
- LOG4CXX_ERROR(logger_,
- "Incorrect statement to delete from app_group_primary.");
- return false;
- }
- query_p.Bind(0, app_id);
- if (!query_p.Exec()) {
- LOG4CXX_ERROR(logger_, "Failed deleting from app_group_primary.");
- return false;
- }
-#endif // SDL_REMOTE_CONTROL
if (!CopyApplication(kDefaultId, app_id)) {
return false;