summaryrefslogtreecommitdiff
path: root/src/components/policy/policy_external/include/policy/cache_manager.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/policy/policy_external/include/policy/cache_manager.h')
-rw-r--r--src/components/policy/policy_external/include/policy/cache_manager.h45
1 files changed, 35 insertions, 10 deletions
diff --git a/src/components/policy/policy_external/include/policy/cache_manager.h b/src/components/policy/policy_external/include/policy/cache_manager.h
index bda456c90a..d30e7cea24 100644
--- a/src/components/policy/policy_external/include/policy/cache_manager.h
+++ b/src/components/policy/policy_external/include/policy/cache_manager.h
@@ -35,7 +35,6 @@
#include <map>
-#include "utils/shared_ptr.h"
#include "policy/pt_representation.h"
#include "policy/pt_ext_representation.h"
#include "policy/usage_statistics/statistics_manager.h"
@@ -84,6 +83,22 @@ class CacheManager : public CacheManagerInterface {
CheckPermissionResult& result);
/**
+ * @brief Get state of request types for given application
+ * @param policy_app_id Unique application id
+ * @return request type state
+ */
+ RequestType::State GetAppRequestTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
+ * @brief Get state of request subtypes for given application
+ * @param policy_app_id Unique application id
+ * @return request subtype state
+ */
+ RequestSubType::State GetAppRequestSubTypesState(
+ const std::string& policy_app_id) const OVERRIDE;
+
+ /**
* @brief Returns true if Policy Table was not updated yet
* from preloaded pt file.
*/
@@ -216,7 +231,7 @@ class CacheManager : public CacheManagerInterface {
* device_info, statistics, excluding user messages
* @return Generated structure for obtaining Json string.
*/
- virtual utils::SharedPtr<policy_table::Table> GenerateSnapshot();
+ virtual std::shared_ptr<policy_table::Table> GenerateSnapshot();
/**
* Applies policy table to the current table
@@ -642,8 +657,18 @@ class CacheManager : public CacheManagerInterface {
* @param policy_app_id Unique application id
* @param request_types Request types of application
*/
- void GetAppRequestTypes(const std::string& policy_app_id,
- std::vector<std::string>& request_types) const;
+ void GetAppRequestTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_types) const OVERRIDE;
+
+ /**
+ * @brief Gets request subtypes for application
+ * @param policy_app_id Unique application id
+ * @param request_subtypes Request subtypes of application to be filled
+ */
+ void GetAppRequestSubTypes(
+ const std::string& policy_app_id,
+ std::vector<std::string>& request_subtypes) const OVERRIDE;
virtual const MetaInfo GetMetaInfo() const OVERRIDE;
@@ -694,7 +719,7 @@ class CacheManager : public CacheManagerInterface {
void SetExternalConsentForApp(const PermissionConsent& permissions) OVERRIDE;
#ifdef BUILD_TESTS
- utils::SharedPtr<policy_table::Table> GetPT() const {
+ std::shared_ptr<policy_table::Table> GetPT() const {
return pt_;
}
#endif
@@ -756,15 +781,15 @@ class CacheManager : public CacheManagerInterface {
policy::Permissions& permission);
private:
- utils::SharedPtr<policy_table::Table> pt_;
- utils::SharedPtr<policy_table::Table> snapshot_;
- utils::SharedPtr<PTRepresentation> backup_;
- utils::SharedPtr<PTExtRepresentation> ex_backup_;
+ std::shared_ptr<policy_table::Table> pt_;
+ std::shared_ptr<policy_table::Table> snapshot_;
+ std::shared_ptr<PTRepresentation> backup_;
+ std::shared_ptr<PTExtRepresentation> ex_backup_;
bool update_required;
typedef std::set<std::string> UnpairedDevices;
UnpairedDevices is_unpaired_;
- mutable sync_primitives::Lock cache_lock_;
+ mutable sync_primitives::RecursiveLock cache_lock_;
sync_primitives::Lock unpaired_lock_;
typedef std::map<std::string, Permissions> AppCalculatedPermissions;