Skip to content

Commit

Permalink
Merge pull request #5090 from npoltorapavlo/RDK-48344_main
Browse files Browse the repository at this point in the history
Rdk 48344 main
  • Loading branch information
srikanth-vv authored Apr 1, 2024
2 parents b18c042 + 2962a9b commit 8a7eedb
Show file tree
Hide file tree
Showing 28 changed files with 888 additions and 1,129 deletions.
5 changes: 5 additions & 0 deletions PersistentStore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ All notable changes to this RDK Service will be documented in this file.

* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.

## [1.0.9] - 2024-04-01
### Added
- Get token from auth service, supply ids in the cloud calls
- Return ERROR_NOT_SUPPORTED if unsupported

## [1.0.8] - 2024-03-21
### Added
- Account scope implementation
Expand Down
3 changes: 0 additions & 3 deletions PersistentStore/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ install(TARGETS ${MODULE_NAME}
set(PLUGIN_IMPLEMENTATION ${MODULE_NAME}Implementation)
add_library(${PLUGIN_IMPLEMENTATION} SHARED
sqlite/Store2.cpp
sqlite/StoreCache.cpp
sqlite/StoreInspector.cpp
sqlite/StoreLimit.cpp
grpc/Store2.cpp
Module.cpp
)
Expand Down
1 change: 0 additions & 1 deletion PersistentStore/Module.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#define MAXSIZE_ENV "PERSISTENTSTORE_MAXSIZE"
#define MAXVALUE_ENV "PERSISTENTSTORE_MAXVALUE"
#define LIMIT_ENV "PERSISTENTSTORE_LIMIT"
#define TOKEN_COMMAND_ENV "PERSISTENTSTORE_TOKEN_COMMAND"
#define IARM_INIT_NAME "Thunder_Plugins"
#define URI_RFC "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.PersistentStore.Uri"

Expand Down
1 change: 0 additions & 1 deletion PersistentStore/PersistentStore.conf.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ configuration.add("key", "@PLUGIN_PERSISTENTSTORE_KEY@")
configuration.add("maxsize", "@PLUGIN_PERSISTENTSTORE_MAXSIZE@")
configuration.add("maxvalue", "@PLUGIN_PERSISTENTSTORE_MAXVALUE@")
configuration.add("limit", "@PLUGIN_PERSISTENTSTORE_LIMIT@")
configuration.add("tokencommand", "@PLUGIN_PERSISTENTSTORE_TOKEN_COMMAND@")
1 change: 0 additions & 1 deletion PersistentStore/PersistentStore.config
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ map()
kv(maxsize ${PLUGIN_PERSISTENTSTORE_MAXSIZE})
kv(maxvalue ${PLUGIN_PERSISTENTSTORE_MAXVALUE})
kv(limit ${PLUGIN_PERSISTENTSTORE_LIMIT})
kv(tokencommand ${PLUGIN_PERSISTENTSTORE_TOKEN_COMMAND})
end()
ans(configuration)
67 changes: 30 additions & 37 deletions PersistentStore/PersistentStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#define API_VERSION_NUMBER_MAJOR 1
#define API_VERSION_NUMBER_MINOR 0
#define API_VERSION_NUMBER_PATCH 8
#define API_VERSION_NUMBER_PATCH 9

namespace WPEFramework {

Expand Down Expand Up @@ -90,57 +90,50 @@ namespace Plugin {
Core::SystemInfo::SetEnvironment(MAXSIZE_ENV, std::to_string(_config.MaxSize.Value()));
Core::SystemInfo::SetEnvironment(MAXVALUE_ENV, std::to_string(_config.MaxValue.Value()));
Core::SystemInfo::SetEnvironment(LIMIT_ENV, std::to_string(_config.Limit.Value()));
Core::SystemInfo::SetEnvironment(TOKEN_COMMAND_ENV, _config.TokenCommand.Value());

uint32_t connectionId;

Store2::ScopeMapType initList1;
auto deviceStore2 = service->Root<Exchange::IStore2>(connectionId, 2000, _T("SqliteStore2"));
if (deviceStore2 != nullptr) {
initList1.emplace(Exchange::IStore2::ScopeType::DEVICE, deviceStore2);
_deviceStore2 = service->Root<Exchange::IStore2>(connectionId, 2000, _T("SqliteStore2"));
if (_deviceStore2 != nullptr) {
_deviceStore2->Register(&_store2Sink);
_deviceStore2->Register(_store);
_deviceStoreCache = _deviceStore2->QueryInterface<Exchange::IStoreCache>();
_deviceStoreInspector = _deviceStore2->QueryInterface<Exchange::IStoreInspector>();
_deviceStoreLimit = _deviceStore2->QueryInterface<Exchange::IStoreLimit>();
}
auto accountStore2 = service->Root<Exchange::IStore2>(connectionId, 2000, _T("GrpcStore2"));
if (accountStore2 != nullptr) {
initList1.emplace(Exchange::IStore2::ScopeType::ACCOUNT, accountStore2);
}
_store2 = Core::Service<Store2>::Create<Exchange::IStore2>(initList1);
if (deviceStore2 != nullptr) {
deviceStore2->Release();
}
if (accountStore2 != nullptr) {
accountStore2->Release();

_accountStore2 = service->Root<Exchange::IStore2>(connectionId, 2000, _T("GrpcStore2"));
if (_accountStore2 != nullptr) {
_accountStore2->Register(&_store2Sink);
}
_store2->Register(&_store2Sink);
_store = Core::Service<Store>::Create<Exchange::IStore>(_store2);
_storeCache = service->Root<Exchange::IStoreCache>(connectionId, 2000, _T("SqliteStoreCache"));
_storeInspector = service->Root<Exchange::IStoreInspector>(connectionId, 2000, _T("SqliteStoreInspector"));
_storeLimit = service->Root<Exchange::IStoreLimit>(connectionId, 2000, _T("SqliteStoreLimit"));

return result;
}

void PersistentStore::Deinitialize(PluginHost::IShell* /* service */)
{
if (_store != nullptr) {
_store->Release();
_store = nullptr;
if (_deviceStore2 != nullptr) {
_deviceStore2->Unregister(&_store2Sink);
_deviceStore2->Unregister(_store);
_deviceStore2->Release();
_deviceStore2 = nullptr;
}
if (_store2 != nullptr) {
_store2->Unregister(&_store2Sink);
_store2->Release();
_store2 = nullptr;
if (_deviceStoreCache != nullptr) {
_deviceStoreCache->Release();
_deviceStoreCache = nullptr;
}
if (_storeCache != nullptr) {
_storeCache->Release();
_storeCache = nullptr;
if (_deviceStoreInspector != nullptr) {
_deviceStoreInspector->Release();
_deviceStoreInspector = nullptr;
}
if (_storeInspector != nullptr) {
_storeInspector->Release();
_storeInspector = nullptr;
if (_deviceStoreLimit != nullptr) {
_deviceStoreLimit->Release();
_deviceStoreLimit = nullptr;
}
if (_storeLimit != nullptr) {
_storeLimit->Release();
_storeLimit = nullptr;
if (_accountStore2 != nullptr) {
_accountStore2->Unregister(&_store2Sink);
_accountStore2->Release();
_accountStore2 = nullptr;
}
}

Expand Down
Loading

0 comments on commit 8a7eedb

Please sign in to comment.