diff --git a/Dictionary/Dictionary.cpp b/Dictionary/Dictionary.cpp index 846b88527..75a023ded 100644 --- a/Dictionary/Dictionary.cpp +++ b/Dictionary/Dictionary.cpp @@ -227,9 +227,9 @@ namespace Plugin { return (result); } - /* virtual */ bool Dictionary::Get(const string& nameSpace, const string& key, string& value) const + /* virtual */ Core::hresult Dictionary::Get(const string& nameSpace, const string& key, string& value) const { - bool result = false; + Core::hresult result = Core::ERROR_UNKNOWN_KEY; _adminLock.Lock(); @@ -244,7 +244,7 @@ namespace Plugin { } if (listIndex != container.end()) { - result = true; + result = Core::ERROR_NONE; value = listIndex->Value(); } } @@ -281,10 +281,10 @@ namespace Plugin { // Direct method to Set a value for a key in a certain namespace from the dictionary. // NameSpace and key MUST be filled. - /* virtual */ bool Dictionary::Set(const string& nameSpace, const string& key, const string& value) + /* virtual */ Core::hresult Dictionary::Set(const string& nameSpace, const string& key, const string& value) { // Direct method to Set a value for a key in a certain namespace from the dictionary. - bool result = false; + Core::hresult result = Core::ERROR_UNKNOWN_KEY; _adminLock.Lock(); @@ -296,14 +296,14 @@ namespace Plugin { } if (listIndex == container.end()) { - result = true; + result = Core::ERROR_NONE; container.push_back(RuntimeEntry(key, value, VOLATILE)); } else if (listIndex->Value() != value) { - result = true; + result = Core::ERROR_NONE; listIndex->Value(value); } - if (result == true) { + if (result == Core::ERROR_NONE) { ObserverMap::iterator index(_observers.begin()); // Right, we updated send out the modification !!! diff --git a/Dictionary/Dictionary.h b/Dictionary/Dictionary.h index 056491dbc..f9d394385 100644 --- a/Dictionary/Dictionary.h +++ b/Dictionary/Dictionary.h @@ -391,12 +391,12 @@ namespace Plugin { // ------------------------------------------------------------------------------------------------------- // Direct method to Get a value from a key in a certain namespace from the dictionary. // NameSpace and key MUST be filled. - bool Get(const string& nameSpace, const string& key, string& value) const override; + Core::hresult Get(const string& nameSpace, const string& key, string& value) const override; IDictionary::IIterator* Get(const string& nameSpace) const override; // Direct method to Set a value for a key in a certain namespace from the dictionary. // NameSpace and key MUST be filled. - bool Set(const string& nameSpace, const string& key, const string& value) override; + Core::hresult Set(const string& nameSpace, const string& key, const string& value) override; void Register(const string& nameSpace, struct Exchange::IDictionary::INotification* sink) override; void Unregister(const string& nameSpace, struct Exchange::IDictionary::INotification* sink) override; diff --git a/ProcessContainers/Containers.h b/ProcessContainers/Containers.h index bbc9a006c..46aadfb8e 100644 --- a/ProcessContainers/Containers.h +++ b/ProcessContainers/Containers.h @@ -63,7 +63,7 @@ namespace Plugin { uint32_t endpoint_start(const JsonData::Containers::StartParamsData& params); uint32_t endpoint_stop(const JsonData::Containers::StopParamsData& params); uint32_t get_containers(Core::JSON::ArrayType& response) const; - uint32_t get_networks(const string& index, Core::JSON::ArrayType& response) const; + uint32_t get_networks(const string& index, Core::JSON::ArrayType& response) const; uint32_t get_memory(const string& index, JsonData::Containers::MemoryData& response) const; uint32_t get_cpu(const string& index, JsonData::Containers::CpuData& response) const; }; diff --git a/ProcessContainers/ContainersJsonRpc.cpp b/ProcessContainers/ContainersJsonRpc.cpp index dbe112321..821db9bd6 100644 --- a/ProcessContainers/ContainersJsonRpc.cpp +++ b/ProcessContainers/ContainersJsonRpc.cpp @@ -36,7 +36,7 @@ namespace Plugin { Register(_T("start"), &Containers::endpoint_start, this); Register(_T("stop"), &Containers::endpoint_stop, this); Property>(_T("containers"), &Containers::get_containers, nullptr, this); - Property>(_T("networks"), &Containers::get_networks, nullptr, this); + Property>(_T("networks"), &Containers::get_networks, nullptr, this); Property(_T("memory"), &Containers::get_memory, nullptr, this); Property(_T("cpu"), &Containers::get_cpu, nullptr, this); } @@ -137,7 +137,7 @@ namespace Plugin { // Return codes: // - ERROR_NONE: Success // - ERROR_UNAVAILABLE: Container not found - uint32_t Containers::get_networks(const string& index, Core::JSON::ArrayType& response) const + uint32_t Containers::get_networks(const string& index, Core::JSON::ArrayType& response) const { uint32_t result = Core::ERROR_NONE; @@ -149,7 +149,7 @@ namespace Plugin { if (iterator != nullptr) { while(iterator->Next() == true) { - NetworksData networkData; + NetworksResultDataElem networkData; networkData.Interface = iterator->Name(); diff --git a/examples/OutOfProcessPlugin/OutOfProcessPlugin.cpp b/examples/OutOfProcessPlugin/OutOfProcessPlugin.cpp index f7d92fe62..447fa9771 100644 --- a/examples/OutOfProcessPlugin/OutOfProcessPlugin.cpp +++ b/examples/OutOfProcessPlugin/OutOfProcessPlugin.cpp @@ -82,7 +82,7 @@ namespace Plugin { _browserresources = _browser->QueryInterface(); if( _browserresources != nullptr) { Exchange::JBrowserResources::Register(*this, _browserresources); - Register("bigupdate", [this](const Core::JSONRPC::Context&, const string& params){ + Register("bigupdate", [this](const Core::JSONRPC::Context&, const string& params, Core::OptionalType&) { uint32_t updates = 5000; string sleep("100"); if(params.empty() == false) {