~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 */
~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 */
~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 */
#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"
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);
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;
}
#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()
{
}
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);
#include <json.h>
#include <types_internal.h>
#include <db_mgr.h>
-#include <zone_util.h>
#include "app_stats_types.h"
#include "db_init.h"
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");
#include <json.h>
#include <types_internal.h>
#include <db_mgr.h>
-#include <zone_util.h>
#include "app_stats_types.h"
#include "install_monitor.h"
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");
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);
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");
#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()
{
}
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);
#include <glib.h>
#include <string>
-#include <zone_util.h>
#include <context_mgr.h>
#include <media_statistics_provider.h>
#include "media_stats_types.h"
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);
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;
}
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;
}
#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)
{
}
{
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;
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);
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);
#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()
{
}
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);
#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"
_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);
#include <types_internal.h>
#include <json.h>
-#include <zone_util.h>
#include <context_mgr.h>
#include <social_statistics_provider.h>
#include "db_handle.h"
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);
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;
}
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;
}