Remove Vasum zone control code 54/44354/1
authorMu-Woong <muwoong.lee@samsung.com>
Tue, 21 Jul 2015 06:09:55 +0000 (15:09 +0900)
committerMu-Woong <muwoong.lee@samsung.com>
Tue, 21 Jul 2015 06:09:55 +0000 (15:09 +0900)
Change-Id: I4c931851a596f553373e98b45031455b9fab2752
Signed-off-by: Mu-Woong <muwoong.lee@samsung.com>
19 files changed:
include/app_statistics_provider.h
include/media_statistics_provider.h
include/social_statistics_provider.h
src/app/app_stats_provider.cpp
src/app/db_handle.cpp
src/app/db_handle.h
src/app/db_init.cpp
src/app/install_monitor.cpp
src/media/db_handle.cpp
src/media/db_handle.h
src/media/media_stats_provider.cpp
src/media_dummy/media_stats_provider.cpp
src/shared/db_handle_base.cpp
src/shared/db_handle_base.h
src/social/db_handle.cpp
src/social/db_handle.h
src/social/log_aggregator.cpp
src/social/social_stats_provider.cpp
src/social_dummy/social_stats_provider.cpp

index ee55db0..434c536 100644 (file)
@@ -27,11 +27,11 @@ namespace ctx {
                        ~app_statistics_provider();
 
                        bool init();
-                       bool is_supported(const char* subject, const char* zone);
-                       int subscribe(const char* subject, ctx::json option, ctx::json* request_result, const char* zone);
-                       int unsubscribe(const char* subject, ctx::json option, const char* zone);
-                       int read(const char* subject, ctx::json option, ctx::json* request_result, const char* zone);
-                       int write(const char* subject, ctx::json data, ctx::json* request_result, const char* zone);
+                       bool is_supported(const char* subject);
+                       int subscribe(const char* subject, ctx::json option, ctx::json* request_result);
+                       int unsubscribe(const char* subject, ctx::json option);
+                       int read(const char* subject, ctx::json option, ctx::json* request_result);
+                       int write(const char* subject, ctx::json data, ctx::json* request_result);
 
        };      /* class app_statistics_provider */
 
index 4de3f5f..fbf638d 100644 (file)
@@ -27,11 +27,11 @@ namespace ctx {
                        ~media_statistics_provider();
 
                        bool init();
-                       bool is_supported(const char* subject, const char* zone);
-                       int subscribe(const char* subject, ctx::json option, ctx::json* request_result, const char* zone);
-                       int unsubscribe(const char* subject, ctx::json option, const char* zone);
-                       int read(const char* subject, ctx::json option, ctx::json* request_result, const char* zone);
-                       int write(const char* subject, ctx::json data, ctx::json* request_result, const char* zone);
+                       bool is_supported(const char* subject);
+                       int subscribe(const char* subject, ctx::json option, ctx::json* request_result);
+                       int unsubscribe(const char* subject, ctx::json option);
+                       int read(const char* subject, ctx::json option, ctx::json* request_result);
+                       int write(const char* subject, ctx::json data, ctx::json* request_result);
 
        };      /* class media_statistics_provider */
 
index c4c246c..cb6fe06 100644 (file)
@@ -27,11 +27,11 @@ namespace ctx {
                        ~social_statistics_provider();
 
                        bool init();
-                       bool is_supported(const char* subject, const char* zone);
-                       int subscribe(const char* subject, ctx::json option, ctx::json* request_result, const char* zone);
-                       int unsubscribe(const char* subject, ctx::json option, const char* zone);
-                       int read(const char* subject, ctx::json option, ctx::json* request_result, const char* zone);
-                       int write(const char* subject, ctx::json data, ctx::json* request_result, const char* zone);
+                       bool is_supported(const char* subject);
+                       int subscribe(const char* subject, ctx::json option, ctx::json* request_result);
+                       int unsubscribe(const char* subject, ctx::json option);
+                       int read(const char* subject, ctx::json option, ctx::json* request_result);
+                       int write(const char* subject, ctx::json data, ctx::json* request_result);
        };      /* class social_statistics_provider */
 
 }      /* namespace ctx */
index 162b73a..b15b38f 100644 (file)
@@ -17,7 +17,6 @@
 #include <types_internal.h>
 #include <json.h>
 #include <context_mgr.h>
-#include <zone_util.h>
 #include <app_statistics_provider.h>
 #include "db_handle.h"
 #include "app_stats_types.h"
@@ -72,34 +71,24 @@ CATCH:
        return false;
 }
 
-bool ctx::app_statistics_provider::is_supported(const char* subject, const char* zone)
+bool ctx::app_statistics_provider::is_supported(const char* subject)
 {
-       if (!STR_EQ(zone, zone_util::default_zone())) {
-               _D("Not supported in the current zone '%s'", zone);
-               return false;
-       }
-
        return true;
 }
 
-int ctx::app_statistics_provider::subscribe(const char* subject, ctx::json option, ctx::json* request_result, const char* zone)
+int ctx::app_statistics_provider::subscribe(const char* subject, ctx::json option, ctx::json* request_result)
 {
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::app_statistics_provider::unsubscribe(const char* subject, ctx::json option, const char* zone)
+int ctx::app_statistics_provider::unsubscribe(const char* subject, ctx::json option)
 {
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::app_statistics_provider::read(const char* subject, ctx::json option, ctx::json* request_result, const char* zone)
+int ctx::app_statistics_provider::read(const char* subject, ctx::json option, ctx::json* request_result)
 {
-       if (!STR_EQ(zone, zone_util::default_zone())) {
-               _D("Not supported in the current zone '%s'", zone);
-               return ERR_NOT_SUPPORTED;
-       }
-
-       ctx::app_db_handle *handle = new(std::nothrow) ctx::app_db_handle(zone);
+       ctx::app_db_handle *handle = new(std::nothrow) ctx::app_db_handle();
        IF_FAIL_RETURN_TAG(handle, ERR_OPERATION_FAILED, _E, "Memory allocation failed");
 
        int err = handle->read(subject, option);
@@ -111,7 +100,7 @@ int ctx::app_statistics_provider::read(const char* subject, ctx::json option, ct
        return ERR_NONE;
 }
 
-int ctx::app_statistics_provider::write(const char* subject, ctx::json data, ctx::json* request_result, const char* zone)
+int ctx::app_statistics_provider::write(const char* subject, ctx::json data, ctx::json* request_result)
 {
        return ERR_NOT_SUPPORTED;
 }
index 8297770..49ff39f 100644 (file)
@@ -21,8 +21,7 @@
 #include "app_stats_types.h"
 #include "db_handle.h"
 
-ctx::app_db_handle::app_db_handle(const char* zone)
-       : stats_db_handle_base(zone)
+ctx::app_db_handle::app_db_handle()
 {
 }
 
index fb31402..691ed72 100644 (file)
@@ -24,7 +24,7 @@
 namespace ctx {
        class app_db_handle : public stats_db_handle_base {
                public:
-                       app_db_handle(const char* zone);
+                       app_db_handle();
                        ~app_db_handle();
 
                        int read(const char* subject, ctx::json filter);
index a81a8df..a5a7af9 100644 (file)
@@ -18,7 +18,6 @@
 #include <json.h>
 #include <types_internal.h>
 #include <db_mgr.h>
-#include <zone_util.h>
 #include "app_stats_types.h"
 #include "db_init.h"
 
@@ -56,8 +55,6 @@ void ctx::app_db_initializer::duplicate_app_list()
        int err;
        package_manager_filter_h filter;
 
-       scope_zone_joiner sz(zone_util::default_zone());
-
        err = package_manager_filter_create(&filter);
        IF_FAIL_VOID_TAG(err == PACKAGE_MANAGER_ERROR_NONE, _E, "package_manager_filter_create() failed");
 
index c583c3e..50f8435 100644 (file)
@@ -19,7 +19,6 @@
 #include <json.h>
 #include <types_internal.h>
 #include <db_mgr.h>
-#include <zone_util.h>
 #include "app_stats_types.h"
 #include "install_monitor.h"
 
@@ -38,8 +37,6 @@ ctx::app_install_monitor::~app_install_monitor()
 
 bool ctx::app_install_monitor::start_monitoring()
 {
-       scope_zone_joiner sz(zone_util::default_zone());
-
        int err = package_manager_create(&pkgmgr_h);
        IF_FAIL_RETURN_TAG(err == PACKAGE_MANAGER_ERROR_NONE, false, _E, "package_manager_create() failed");
 
@@ -51,8 +48,6 @@ bool ctx::app_install_monitor::start_monitoring()
 
 void ctx::app_install_monitor::stop_monitoring()
 {
-       scope_zone_joiner sz(zone_util::default_zone());
-
        if(pkgmgr_h) {
                package_manager_unset_event_cb(pkgmgr_h);
                package_manager_destroy(pkgmgr_h);
@@ -70,8 +65,6 @@ void ctx::app_install_monitor::package_event_cb(const char *type, const char *pa
                return;
        }
 
-       scope_zone_joiner sz(zone_util::default_zone());
-
        package_info_h pkg_info;
        int err = package_manager_get_package_info(package, &pkg_info);
        IF_FAIL_VOID_TAG(err == PACKAGE_MANAGER_ERROR_NONE, _E, "package_manager_get_package_info() failed");
index af6afdb..509ca9b 100644 (file)
@@ -22,8 +22,7 @@
 #include "media_stats_types.h"
 #include "db_handle.h"
 
-ctx::media_db_handle::media_db_handle(const char* zone)
-       : stats_db_handle_base(zone)
+ctx::media_db_handle::media_db_handle()
 {
 }
 
index fa1555f..8c59422 100644 (file)
@@ -24,7 +24,7 @@
 namespace ctx {
        class media_db_handle : public stats_db_handle_base {
                public:
-                       media_db_handle(const char* zone);
+                       media_db_handle();
                        ~media_db_handle();
 
                        int read(const char* subject, ctx::json filter);
index 44939cc..757cf80 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <glib.h>
 #include <string>
-#include <zone_util.h>
 #include <context_mgr.h>
 #include <media_statistics_provider.h>
 #include "media_stats_types.h"
@@ -50,34 +49,24 @@ bool ctx::media_statistics_provider::init()
        return true;
 }
 
-bool ctx::media_statistics_provider::is_supported(const char* subject, const char* zone)
+bool ctx::media_statistics_provider::is_supported(const char* subject)
 {
-       if (!STR_EQ(zone, zone_util::default_zone())) {
-               _D("Not supported in the current zone '%s'", zone);
-               return false;
-       }
-
        return true;
 }
 
-int ctx::media_statistics_provider::subscribe(const char* subject, ctx::json option, ctx::json* request_result, const char* zone)
+int ctx::media_statistics_provider::subscribe(const char* subject, ctx::json option, ctx::json* request_result)
 {
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::media_statistics_provider::unsubscribe(const char* subject, ctx::json option, const char* zone)
+int ctx::media_statistics_provider::unsubscribe(const char* subject, ctx::json option)
 {
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::media_statistics_provider::read(const char* subject, ctx::json option, ctx::json* request_result, const char* zone)
+int ctx::media_statistics_provider::read(const char* subject, ctx::json option, ctx::json* request_result)
 {
-       if (!STR_EQ(zone, zone_util::default_zone())) {
-               _D("Not supported in the current zone '%s'", zone);
-               return ERR_NOT_SUPPORTED;
-       }
-
-       media_db_handle *handle = new(std::nothrow) media_db_handle(zone);
+       media_db_handle *handle = new(std::nothrow) media_db_handle();
        IF_FAIL_RETURN_TAG(handle, ERR_OPERATION_FAILED, _E, "Memory allocation failed");
 
        int err = handle->read(subject, option);
@@ -89,7 +78,7 @@ int ctx::media_statistics_provider::read(const char* subject, ctx::json option,
        return ERR_NONE;
 }
 
-int ctx::media_statistics_provider::write(const char* subject, ctx::json data, ctx::json* request_result, const char* zone)
+int ctx::media_statistics_provider::write(const char* subject, ctx::json data, ctx::json* request_result)
 {
        return ERR_NOT_SUPPORTED;
 }
index 047cf77..b42e4c2 100644 (file)
@@ -31,27 +31,27 @@ bool ctx::media_statistics_provider::init()
        return true;
 }
 
-bool ctx::media_statistics_provider::is_supported(const char* subject, const char* zone)
+bool ctx::media_statistics_provider::is_supported(const char* subject)
 {
        return false;
 }
 
-int ctx::media_statistics_provider::subscribe(const char* subject, ctx::json option, ctx::json* request_result, const char* zone)
+int ctx::media_statistics_provider::subscribe(const char* subject, ctx::json option, ctx::json* request_result)
 {
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::media_statistics_provider::unsubscribe(const char* subject, ctx::json option, const char* zone)
+int ctx::media_statistics_provider::unsubscribe(const char* subject, ctx::json option)
 {
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::media_statistics_provider::read(const char* subject, ctx::json option, ctx::json* request_result, const char* zone)
+int ctx::media_statistics_provider::read(const char* subject, ctx::json option, ctx::json* request_result)
 {
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::media_statistics_provider::write(const char* subject, ctx::json data, ctx::json* request_result, const char* zone)
+int ctx::media_statistics_provider::write(const char* subject, ctx::json data, ctx::json* request_result)
 {
        return ERR_NOT_SUPPORTED;
 }
index 33813ed..50c59a7 100644 (file)
@@ -24,9 +24,8 @@
 #define DAY_OF_WEEK(SECOND) "CAST(strftime('%w', " SECOND ", 'unixepoch') AS INTEGER)"
 #define HOUR_OF_DAY(SECOND) "CAST(strftime('%H', " SECOND ", 'unixepoch') AS INTEGER)"
 
-ctx::stats_db_handle_base::stats_db_handle_base(const char* zone)
+ctx::stats_db_handle_base::stats_db_handle_base()
        : is_trigger_item(false)
-       , req_zone(zone)
 {
 }
 
@@ -212,16 +211,16 @@ void ctx::stats_db_handle_base::on_query_result_received(unsigned int query_id,
 {
        if (is_trigger_item) {
                if (records.size() == 1) {
-                       context_manager::reply_to_read(req_subject.c_str(), req_filter, error, records[0], req_zone.c_str());
+                       context_manager::reply_to_read(req_subject.c_str(), req_filter, error, records[0]);
                } else {
                        _E("Invalid query result");
                        json dummy;
-                       context_manager::reply_to_read(req_subject.c_str(), req_filter, ERR_OPERATION_FAILED, dummy, req_zone.c_str());
+                       context_manager::reply_to_read(req_subject.c_str(), req_filter, ERR_OPERATION_FAILED, dummy);
                }
        } else {
                json results = "{\"" STATS_QUERY_RESULT "\":[]}";
                json_vector_to_array(records, results);
-               context_manager::reply_to_read(req_subject.c_str(), req_filter, error, results, req_zone.c_str());
+               context_manager::reply_to_read(req_subject.c_str(), req_filter, error, results);
        }
 
        delete this;
index 8c22d37..a27817c 100644 (file)
@@ -27,7 +27,7 @@ namespace ctx {
                        bool is_trigger_item;
                        std::string req_subject;
 
-                       stats_db_handle_base(const char* zone);
+                       stats_db_handle_base();
                        ~stats_db_handle_base();
 
                        std::string create_where_clause(ctx::json filter);
@@ -38,7 +38,6 @@ namespace ctx {
                        static int generate_qid();
 
                private:
-                       std::string req_zone;
                        ctx::json req_filter;
 
                        void json_vector_to_array(std::vector<json> &vec_json, ctx::json &json_result);
index 8ac51cc..6088091 100644 (file)
@@ -22,8 +22,7 @@
 #include "social_stats_types.h"
 #include "db_handle.h"
 
-ctx::social_db_handle::social_db_handle(const char* zone)
-       : stats_db_handle_base(zone)
+ctx::social_db_handle::social_db_handle()
 {
 }
 
index ff24560..8e06c5d 100644 (file)
@@ -24,7 +24,7 @@
 namespace ctx {
        class social_db_handle : public stats_db_handle_base {
                public:
-                       social_db_handle(const char* zone);
+                       social_db_handle();
                        ~social_db_handle();
 
                        int read(const char* subject, ctx::json filter);
index 4d2536f..f0d864c 100644 (file)
@@ -17,7 +17,6 @@
 #include <json.h>
 #include <db_mgr.h>
 #include <timer_mgr.h>
-#include <zone_util.h>
 #include <types_internal.h>
 #include "social_stats_types.h"
 #include "log_aggregator.h"
@@ -69,8 +68,6 @@ void ctx::contact_log_aggregator::on_query_result_received(unsigned int query_id
 
        _D("Last Time: %d / Local - UTC: %d", last_time, time_diff);
 
-       scope_zone_joiner sz(zone_util::default_zone());
-
        contacts_list_h list = NULL;
 
        get_updated_contact_log_list(last_time, &list);
index 706ac7c..e204b14 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <types_internal.h>
 #include <json.h>
-#include <zone_util.h>
 #include <context_mgr.h>
 #include <social_statistics_provider.h>
 #include "db_handle.h"
@@ -45,34 +44,24 @@ bool ctx::social_statistics_provider::init()
        return true;
 }
 
-bool ctx::social_statistics_provider::is_supported(const char* subject, const char* zone)
+bool ctx::social_statistics_provider::is_supported(const char* subject)
 {
-       if (!STR_EQ(zone, zone_util::default_zone())) {
-               _D("Not supported in the current zone '%s'", zone);
-               return false;
-       }
-
        return true;
 }
 
-int ctx::social_statistics_provider::subscribe(const char* subject, ctx::json option, ctx::json* request_result, const char* zone)
+int ctx::social_statistics_provider::subscribe(const char* subject, ctx::json option, ctx::json* request_result)
 {
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::social_statistics_provider::unsubscribe(const char* subject, ctx::json option, const char* zone)
+int ctx::social_statistics_provider::unsubscribe(const char* subject, ctx::json option)
 {
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::social_statistics_provider::read(const char* subject, ctx::json option, ctx::json* request_result, const char* zone)
+int ctx::social_statistics_provider::read(const char* subject, ctx::json option, ctx::json* request_result)
 {
-       if (!STR_EQ(zone, zone_util::default_zone())) {
-               _D("Not supported in the current zone '%s'", zone);
-               return ERR_NOT_SUPPORTED;
-       }
-
-       ctx::social_db_handle *handle = new(std::nothrow) ctx::social_db_handle(zone);
+       ctx::social_db_handle *handle = new(std::nothrow) ctx::social_db_handle();
        IF_FAIL_RETURN_TAG(handle, ERR_OPERATION_FAILED, _E, "Memory allocation failed");
 
        int err = handle->read(subject, option);
@@ -84,7 +73,7 @@ int ctx::social_statistics_provider::read(const char* subject, ctx::json option,
        return ERR_NONE;
 }
 
-int ctx::social_statistics_provider::write(const char* subject, ctx::json data, ctx::json* request_result, const char* zone)
+int ctx::social_statistics_provider::write(const char* subject, ctx::json data, ctx::json* request_result)
 {
        return ERR_NOT_SUPPORTED;
 }
index 4675d20..42b67ac 100644 (file)
@@ -31,27 +31,27 @@ bool ctx::social_statistics_provider::init()
        return true;
 }
 
-bool ctx::social_statistics_provider::is_supported(const char* subject, const char* zone)
+bool ctx::social_statistics_provider::is_supported(const char* subject)
 {
        return false;
 }
 
-int ctx::social_statistics_provider::subscribe(const char* subject, ctx::json option, ctx::json* request_result, const char* zone)
+int ctx::social_statistics_provider::subscribe(const char* subject, ctx::json option, ctx::json* request_result)
 {
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::social_statistics_provider::unsubscribe(const char* subject, ctx::json option, const char* zone)
+int ctx::social_statistics_provider::unsubscribe(const char* subject, ctx::json option)
 {
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::social_statistics_provider::read(const char* subject, ctx::json option, ctx::json* request_result, const char* zone)
+int ctx::social_statistics_provider::read(const char* subject, ctx::json option, ctx::json* request_result)
 {
        return ERR_NOT_SUPPORTED;
 }
 
-int ctx::social_statistics_provider::write(const char* subject, ctx::json data, ctx::json* request_result, const char* zone)
+int ctx::social_statistics_provider::write(const char* subject, ctx::json data, ctx::json* request_result)
 {
        return ERR_NOT_SUPPORTED;
 }