-//******************************************************************\r
-//\r
-// Copyright 2016 Samsung Electronics All Rights Reserved.\r
-//\r
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-//\r
-// Licensed under the Apache License, Version 2.0 (the "License");\r
-// you may not use this file except in compliance with the License.\r
-// You may obtain a copy of the License at\r
-//\r
-// http://www.apache.org/licenses/LICENSE-2.0\r
-//\r
-// Unless required by applicable law or agreed to in writing, software\r
-// distributed under the License is distributed on an "AS IS" BASIS,\r
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-// See the License for the specific language governing permissions and\r
-// limitations under the License.\r
-//\r
-//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\r
-\r
-#include "NSConsumerService.h"\r
-#include <cstring>\r
-#include "NSConsumerInterface.h"\r
-#include "NSAcceptedProviders.h"\r
-#include "NSMessage.h"\r
-#include "NSCommon.h"\r
-#include "NSConstants.h"\r
-#include "oic_string.h"\r
-#include "oic_malloc.h"\r
-\r
-namespace OIC\r
-{\r
- namespace Service\r
- {\r
- void NSConsumerService::onProviderStateReceived(::NSProvider *provider, ::NSProviderState state)\r
- {\r
- NS_LOG(DEBUG, "onNSProviderStateChanged - IN");\r
- NS_LOG_V(DEBUG, "provider Id : %s", provider->providerId);\r
- NS_LOG_V(DEBUG, "state : %d", (int)state);\r
-\r
- std::string provId;\r
- provId.assign(provider->providerId, NS_UTILS_UUID_STRING_SIZE - 1);\r
- std::shared_ptr<NSProvider> oldProvider =\r
- NSConsumerService::getInstance()->getProvider(provId);\r
-\r
- if (oldProvider == nullptr)\r
- {\r
- std::shared_ptr<NSProvider> nsProvider = std::make_shared<NSProvider>(provider);\r
- NS_LOG(DEBUG, "Provider with same Id do not exist. updating Data for New Provider");\r
- auto discoveredCallback = NSConsumerService::getInstance()->getProviderDiscoveredCb();\r
- nsProvider->setProviderState((NSProviderState)state);\r
- auto topicLL = NSConsumerGetTopicList(provider->providerId);\r
- nsProvider->setTopicList(new NSTopicsList(topicLL));\r
- NSConsumerService::getInstance()->getAcceptedProviders()->addProvider(nsProvider);\r
- if (state == NS_DISCOVERED)\r
- {\r
- nsProvider->setProviderSubscribedState(NSProviderSubscribedState::DISCOVERED);\r
- if (discoveredCallback != NULL)\r
- {\r
- NS_LOG(DEBUG,\r
- "initiating the Discovered callback : NS_DISCOVERED, policy false, Accepter: Consumer");\r
- discoveredCallback(nsProvider);\r
- }\r
- }\r
- else if (state == NS_ALLOW)\r
- {\r
- nsProvider->setProviderSubscribedState(NSProviderSubscribedState::SUBSCRIBED);\r
- if (discoveredCallback != NULL)\r
- {\r
- NS_LOG(DEBUG, "initiating the Discovered callback : NS_ALLOW, policy true, Accepter: Provider");\r
- discoveredCallback(nsProvider);\r
- }\r
- }\r
- }\r
- else\r
- {\r
- NS_LOG(DEBUG, "Provider with same Id exists. updating the old Provider data");\r
- auto changeCallback = oldProvider->getProviderStateReceivedCb();\r
- auto prevState = oldProvider->getProviderState();\r
- oldProvider->setProviderState((NSProviderState)state);\r
- if (state == NS_ALLOW)\r
- {\r
- oldProvider->setProviderSubscribedState(NSProviderSubscribedState::SUBSCRIBED);\r
- if (changeCallback != NULL)\r
- {\r
- NS_LOG(DEBUG, "initiating the callback for Response : NS_ALLOW");\r
- changeCallback((NSProviderState)state);\r
- }\r
- else\r
- {\r
- oldProvider->setProviderSubscribedState(NSProviderSubscribedState::SUBSCRIBED);\r
- auto discoveredCallback = NSConsumerService::getInstance()->getProviderDiscoveredCb();\r
- if (discoveredCallback != NULL)\r
- {\r
- discoveredCallback(oldProvider);\r
- }\r
- auto changeCallback = oldProvider->getProviderStateReceivedCb();\r
- if (changeCallback != NULL)\r
- {\r
- changeCallback(prevState);\r
- }\r
- }\r
- }\r
- else if (state == NS_DENY)\r
- {\r
- oldProvider->setProviderSubscribedState(NSProviderSubscribedState::DENY);\r
- NSConsumerService::getInstance()->getAcceptedProviders()->removeProvider(\r
- oldProvider->getProviderId());\r
- if (changeCallback != NULL)\r
- {\r
- NS_LOG(DEBUG, "initiating the callback for Response : NS_DENY");\r
- changeCallback((NSProviderState)state);\r
- }\r
- }\r
- else if (state == NS_TOPIC)\r
- {\r
- auto topicLL = NSConsumerGetTopicList(provider->providerId);\r
- oldProvider->setTopicList(new NSTopicsList(topicLL));\r
- if (changeCallback != NULL)\r
- {\r
- NS_LOG(DEBUG, "initiating the callback for Response : NS_TOPIC");\r
- changeCallback((NSProviderState)state);\r
- }\r
- if (topicLL)\r
- {\r
- NSTopicLL *iter = topicLL;\r
- NSTopicLL *following = NULL;\r
-\r
- while (iter)\r
- {\r
- following = iter->next;\r
- if (iter)\r
- {\r
- NSOICFree(iter->topicName);\r
- iter->next = NULL;\r
- NSOICFree(iter);\r
- }\r
- iter = following;\r
- }\r
- }\r
- }\r
- else if (state == NS_STOPPED)\r
- {\r
- oldProvider->setProviderSubscribedState(NSProviderSubscribedState::DENY);\r
- NSConsumerService::getInstance()->getAcceptedProviders()->removeProvider(\r
- oldProvider->getProviderId());\r
- NS_LOG(DEBUG, "initiating the State callback : NS_STOPPED");\r
- if (changeCallback != NULL)\r
- {\r
- NS_LOG(DEBUG, "initiating the callback for Response : NS_STOPPED");\r
- changeCallback((NSProviderState)state);\r
- }\r
- }\r
- }\r
- NS_LOG(DEBUG, "onNSProviderStateChanged - OUT");\r
- }\r
-\r
- void NSConsumerService::onNSMessageReceived(::NSMessage *message)\r
- {\r
- NS_LOG(DEBUG, "onNSMessageReceived - IN");\r
- NS_LOG_V(DEBUG, "message->providerId : %s", message->providerId);\r
-\r
- NSMessage nsMessage(message);\r
-\r
- if (NSConsumerService::getInstance()->getAcceptedProviders()->isAccepted(\r
- nsMessage.getProviderId()))\r
- {\r
- auto provider = NSConsumerService::getInstance()->getProvider(\r
- nsMessage.getProviderId());\r
- if (provider != nullptr)\r
- {\r
- NS_LOG(DEBUG, "Found Provider with given ID");\r
- auto callback = provider->getMessageReceivedCb();\r
- if (callback != NULL)\r
- {\r
- NS_LOG(DEBUG, "initiating the callback for messageReceived");\r
- callback(nsMessage);\r
- }\r
- }\r
- }\r
- NS_LOG(DEBUG, "onNSMessageReceived - OUT");\r
- }\r
-\r
- void NSConsumerService::onNSSyncInfoReceived(::NSSyncInfo *syncInfo)\r
- {\r
- NS_LOG(DEBUG, "onNSSyncInfoReceived - IN");\r
- NS_LOG_V(DEBUG, "syncInfo->providerId : %s", syncInfo->providerId);\r
-\r
- NSSyncInfo nsSyncInfo(syncInfo);\r
-\r
- if (NSConsumerService::getInstance()->getAcceptedProviders()->isAccepted(\r
- nsSyncInfo.getProviderId()))\r
- {\r
- auto provider = NSConsumerService::getInstance()->getProvider(\r
- nsSyncInfo.getProviderId());\r
- if (provider != nullptr)\r
- {\r
- NS_LOG(DEBUG, "Found Provider with given ID");\r
- auto callback = provider->getSyncInfoReceivedCb();\r
- if (callback != NULL)\r
- {\r
- NS_LOG(DEBUG, "initiating the callback for SyncInfoReceived");\r
- callback(nsSyncInfo);\r
- }\r
- }\r
- }\r
- NS_LOG(DEBUG, "onNSSyncInfoReceived - OUT");\r
- }\r
-\r
- NSConsumerService::NSConsumerService()\r
- {\r
- m_providerDiscoveredCb = NULL;\r
- m_acceptedProviders = new NSAcceptedProviders();\r
- }\r
-\r
- NSConsumerService::~NSConsumerService()\r
- {\r
- m_acceptedProviders->removeProviders();\r
- delete m_acceptedProviders;\r
- }\r
-\r
- NSConsumerService *NSConsumerService::getInstance()\r
- {\r
- static NSConsumerService s_instance;\r
- return &s_instance;\r
- }\r
-\r
- NSResult NSConsumerService::start(NSConsumerService::ProviderDiscoveredCallback providerDiscovered)\r
- {\r
- NS_LOG(DEBUG, "start - IN");\r
- m_acceptedProviders->removeProviders();\r
-\r
- m_providerDiscoveredCb = providerDiscovered;\r
- NSConsumerConfig nsConfig;\r
- nsConfig.changedCb = onProviderStateReceived;\r
- nsConfig.messageCb = onNSMessageReceived;\r
- nsConfig.syncInfoCb = onNSSyncInfoReceived;\r
-\r
- NSResult result = (NSResult) NSStartConsumer(nsConfig);\r
- NS_LOG(DEBUG, "start - OUT");\r
- return result;\r
- }\r
-\r
- NSResult NSConsumerService::stop()\r
- {\r
- NS_LOG(DEBUG, "stop - IN");\r
- m_providerDiscoveredCb = NULL;\r
- m_acceptedProviders->removeProviders();\r
-\r
- NSResult result = (NSResult) NSStopConsumer();\r
- NS_LOG(DEBUG, "stop - OUT");\r
- return result;\r
- }\r
-\r
- NSResult NSConsumerService::enableRemoteService(const std::string &serverAddress)\r
- {\r
- NS_LOG(DEBUG, "enableRemoteService - IN");\r
- NS_LOG_V(DEBUG, "Server Address : %s", serverAddress.c_str());\r
- NSResult result = NSResult::ERROR;\r
-#ifdef WITH_CLOUD\r
- result = (NSResult) NSConsumerEnableRemoteService(OICStrdup(serverAddress.c_str()));\r
-#else\r
- NS_LOG(ERROR, "Remote Services feature is not enabled in the Build");\r
- (void) serverAddress;\r
-#endif\r
- NS_LOG(DEBUG, "enableRemoteService - OUT");\r
- return result;\r
- }\r
-\r
- NSResult NSConsumerService::subscribeMQService(const std::string &serverAddress,\r
- const std::string &topicName)\r
- {\r
- NS_LOG(DEBUG, "subscribeMQService - IN");\r
- NS_LOG_V(DEBUG, "Server Address : %s", serverAddress.c_str());\r
- NSResult result = NSResult::ERROR;\r
-#ifdef WITH_MQ\r
- result = (NSResult) NSConsumerSubscribeMQService(\r
- serverAddress.c_str(), topicName.c_str());\r
-#else\r
- NS_LOG(ERROR, "MQ Services feature is not enabled in the Build");\r
- (void) serverAddress;\r
- (void) topicName;\r
-#endif\r
- NS_LOG(DEBUG, "subscribeMQService - OUT");\r
- return result;\r
- }\r
-\r
- NSResult NSConsumerService::rescanProvider()\r
- {\r
- NS_LOG(DEBUG, "rescanProvider - IN");\r
- NSResult result = (NSResult) NSRescanProvider();\r
- NS_LOG(DEBUG, "rescanProvider - OUT");\r
- return result;\r
- }\r
-\r
- NSConsumerService::ProviderDiscoveredCallback NSConsumerService::getProviderDiscoveredCb()\r
- {\r
- return m_providerDiscoveredCb;\r
- }\r
-\r
- std::shared_ptr<NSProvider> NSConsumerService::getProvider(const std::string &id)\r
- {\r
- return m_acceptedProviders->getProvider(id);\r
- }\r
-\r
- NSAcceptedProviders *NSConsumerService::getAcceptedProviders()\r
- {\r
- return m_acceptedProviders;\r
- }\r
- }\r
-}\r
+//******************************************************************
+//
+// Copyright 2016 Samsung Electronics All Rights Reserved.
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
+
+#include "NSConsumerService.h"
+#include <cstring>
+#include "NSConsumerInterface.h"
+#include "NSAcceptedProviders.h"
+#include "NSMessage.h"
+#include "NSCommon.h"
+#include "NSConstants.h"
+#include "oic_string.h"
+#include "oic_malloc.h"
+
+namespace OIC
+{
+ namespace Service
+ {
+ void NSConsumerService::onProviderStateReceived(::NSProvider *provider, ::NSProviderState state)
+ {
+ NS_LOG(DEBUG, "onNSProviderStateChanged - IN");
+ NS_LOG_V(DEBUG, "provider Id : %s", provider->providerId);
+ NS_LOG_V(DEBUG, "state : %d", (int)state);
+
+ std::string provId;
+ provId.assign(provider->providerId, NS_UTILS_UUID_STRING_SIZE - 1);
+ std::shared_ptr<NSProvider> oldProvider =
+ NSConsumerService::getInstance()->getProvider(provId);
+
+ if (oldProvider == nullptr)
+ {
+ //Callback received for First time from new Provider as there is no reference to
+ //previous Provider with same ID in internal map.
+ //States received during discovery of Provider : NS_DISCOVERED and NS_ALLOW
+ std::shared_ptr<NSProvider> nsProvider = std::make_shared<NSProvider>(provider);
+ NS_LOG(DEBUG, "Provider with same Id do not exist. updating Data for New Provider");
+ auto discoveredCallback = NSConsumerService::getInstance()->getProviderDiscoveredCb();
+ nsProvider->setProviderState((NSProviderState)state);
+ auto topicLL = NSConsumerGetTopicList(provider->providerId);
+ nsProvider->setTopicList(new NSTopicsList(topicLL));
+ NSConsumerService::getInstance()->getAcceptedProviders()->addProvider(nsProvider);
+ if (state == NS_DISCOVERED)
+ {
+ nsProvider->setProviderSubscribedState(NSProviderSubscribedState::DISCOVERED);
+ if (discoveredCallback != NULL)
+ {
+ NS_LOG(DEBUG,
+ "initiating the Discovered callback : NS_DISCOVERED, policy false, Accepter: Consumer");
+ discoveredCallback(nsProvider);
+ }
+ }
+ else if (state == NS_ALLOW)
+ {
+ nsProvider->setProviderSubscribedState(NSProviderSubscribedState::SUBSCRIBED);
+ if (discoveredCallback != NULL)
+ {
+ NS_LOG(DEBUG, "initiating the Discovered callback : NS_ALLOW, policy true, Accepter: Provider");
+ discoveredCallback(nsProvider);
+ }
+ }
+ }
+ else
+ {
+ //Callback received from already discovered and existing Provider in internal map.
+ //States received Post discovery of Provider.
+ NS_LOG(DEBUG, "Provider with same Id exists. updating the old Provider data");
+ auto changeCallback = oldProvider->getProviderStateReceivedCb();
+ auto prevState = oldProvider->getProviderState();
+ oldProvider->setProviderState((NSProviderState)state);
+ if (state == NS_ALLOW)
+ {
+ oldProvider->setProviderSubscribedState(NSProviderSubscribedState::SUBSCRIBED);
+ if (changeCallback != NULL)
+ {
+ NS_LOG(DEBUG, "initiating the callback for Response : NS_ALLOW");
+ changeCallback((NSProviderState)state);
+ }
+ else
+ {
+ oldProvider->setProviderSubscribedState(NSProviderSubscribedState::SUBSCRIBED);
+ auto discoveredCallback = NSConsumerService::getInstance()->getProviderDiscoveredCb();
+ if (discoveredCallback != NULL)
+ {
+ discoveredCallback(oldProvider);
+ }
+ auto changeCallback = oldProvider->getProviderStateReceivedCb();
+ if (changeCallback != NULL)
+ {
+ changeCallback(prevState);
+ }
+ }
+ }
+ else if (state == NS_DENY)
+ {
+ oldProvider->setProviderSubscribedState(NSProviderSubscribedState::DENY);
+ NSConsumerService::getInstance()->getAcceptedProviders()->removeProvider(
+ oldProvider->getProviderId());
+ if (changeCallback != NULL)
+ {
+ NS_LOG(DEBUG, "initiating the callback for Response : NS_DENY");
+ changeCallback((NSProviderState)state);
+ }
+ }
+ else if (state == NS_TOPIC)
+ {
+ auto topicLL = NSConsumerGetTopicList(provider->providerId);
+ oldProvider->setTopicList(new NSTopicsList(topicLL));
+ if (changeCallback != NULL)
+ {
+ NS_LOG(DEBUG, "initiating the callback for Response : NS_TOPIC");
+ changeCallback((NSProviderState)state);
+ }
+ if (topicLL)
+ {
+ NSTopicLL *iter = topicLL;
+ NSTopicLL *following = NULL;
+
+ while (iter)
+ {
+ following = iter->next;
+ if (iter)
+ {
+ NSOICFree(iter->topicName);
+ iter->next = NULL;
+ NSOICFree(iter);
+ }
+ iter = following;
+ }
+ }
+ }
+ else if (state == NS_STOPPED)
+ {
+ oldProvider->setProviderSubscribedState(NSProviderSubscribedState::DENY);
+ NSConsumerService::getInstance()->getAcceptedProviders()->removeProvider(
+ oldProvider->getProviderId());
+ NS_LOG(DEBUG, "initiating the State callback : NS_STOPPED");
+ if (changeCallback != NULL)
+ {
+ NS_LOG(DEBUG, "initiating the callback for Response : NS_STOPPED");
+ changeCallback((NSProviderState)state);
+ }
+ }
+ }
+ NS_LOG(DEBUG, "onNSProviderStateChanged - OUT");
+ }
+
+ void NSConsumerService::onNSMessageReceived(::NSMessage *message)
+ {
+ NS_LOG(DEBUG, "onNSMessageReceived - IN");
+ NS_LOG_V(DEBUG, "message->providerId : %s", message->providerId);
+
+ NSMessage nsMessage(message);
+
+ if (NSConsumerService::getInstance()->getAcceptedProviders()->isAccepted(
+ nsMessage.getProviderId()))
+ {
+ auto provider = NSConsumerService::getInstance()->getProvider(
+ nsMessage.getProviderId());
+ if (provider != nullptr)
+ {
+ NS_LOG(DEBUG, "Found Provider with given ID");
+ auto callback = provider->getMessageReceivedCb();
+ if (callback != NULL)
+ {
+ NS_LOG(DEBUG, "initiating the callback for messageReceived");
+ callback(nsMessage);
+ }
+ }
+ }
+ NS_LOG(DEBUG, "onNSMessageReceived - OUT");
+ }
+
+ void NSConsumerService::onNSSyncInfoReceived(::NSSyncInfo *syncInfo)
+ {
+ NS_LOG(DEBUG, "onNSSyncInfoReceived - IN");
+ NS_LOG_V(DEBUG, "syncInfo->providerId : %s", syncInfo->providerId);
+
+ NSSyncInfo nsSyncInfo(syncInfo);
+
+ if (NSConsumerService::getInstance()->getAcceptedProviders()->isAccepted(
+ nsSyncInfo.getProviderId()))
+ {
+ auto provider = NSConsumerService::getInstance()->getProvider(
+ nsSyncInfo.getProviderId());
+ if (provider != nullptr)
+ {
+ NS_LOG(DEBUG, "Found Provider with given ID");
+ auto callback = provider->getSyncInfoReceivedCb();
+ if (callback != NULL)
+ {
+ NS_LOG(DEBUG, "initiating the callback for SyncInfoReceived");
+ callback(nsSyncInfo);
+ }
+ }
+ }
+ NS_LOG(DEBUG, "onNSSyncInfoReceived - OUT");
+ }
+
+ NSConsumerService::NSConsumerService()
+ {
+ m_providerDiscoveredCb = NULL;
+ m_acceptedProviders = new NSAcceptedProviders();
+ }
+
+ NSConsumerService::~NSConsumerService()
+ {
+ m_acceptedProviders->removeProviders();
+ delete m_acceptedProviders;
+ }
+
+ NSConsumerService *NSConsumerService::getInstance()
+ {
+ static NSConsumerService s_instance;
+ return &s_instance;
+ }
+
+ NSResult NSConsumerService::start(NSConsumerService::ProviderDiscoveredCallback providerDiscovered)
+ {
+ NS_LOG(DEBUG, "start - IN");
+ m_acceptedProviders->removeProviders();
+
+ m_providerDiscoveredCb = providerDiscovered;
+ NSConsumerConfig nsConfig;
+ nsConfig.changedCb = onProviderStateReceived;
+ nsConfig.messageCb = onNSMessageReceived;
+ nsConfig.syncInfoCb = onNSSyncInfoReceived;
+
+ NSResult result = (NSResult) NSStartConsumer(nsConfig);
+ NS_LOG(DEBUG, "start - OUT");
+ return result;
+ }
+
+ NSResult NSConsumerService::stop()
+ {
+ NS_LOG(DEBUG, "stop - IN");
+ m_providerDiscoveredCb = NULL;
+ m_acceptedProviders->removeProviders();
+
+ NSResult result = (NSResult) NSStopConsumer();
+ NS_LOG(DEBUG, "stop - OUT");
+ return result;
+ }
+
+ NSResult NSConsumerService::enableRemoteService(const std::string &serverAddress)
+ {
+ NS_LOG(DEBUG, "enableRemoteService - IN");
+ NS_LOG_V(DEBUG, "Server Address : %s", serverAddress.c_str());
+ NSResult result = NSResult::ERROR;
+#ifdef WITH_CLOUD
+ result = (NSResult) NSConsumerEnableRemoteService(OICStrdup(serverAddress.c_str()));
+#else
+ NS_LOG(ERROR, "Remote Services feature is not enabled in the Build");
+ (void) serverAddress;
+#endif
+ NS_LOG(DEBUG, "enableRemoteService - OUT");
+ return result;
+ }
+
+ NSResult NSConsumerService::subscribeMQService(const std::string &serverAddress,
+ const std::string &topicName)
+ {
+ NS_LOG(DEBUG, "subscribeMQService - IN");
+ NS_LOG_V(DEBUG, "Server Address : %s", serverAddress.c_str());
+ NSResult result = NSResult::ERROR;
+#ifdef WITH_MQ
+ result = (NSResult) NSConsumerSubscribeMQService(
+ serverAddress.c_str(), topicName.c_str());
+#else
+ NS_LOG(ERROR, "MQ Services feature is not enabled in the Build");
+ (void) serverAddress;
+ (void) topicName;
+#endif
+ NS_LOG(DEBUG, "subscribeMQService - OUT");
+ return result;
+ }
+
+ NSResult NSConsumerService::rescanProvider()
+ {
+ NS_LOG(DEBUG, "rescanProvider - IN");
+ NSResult result = (NSResult) NSRescanProvider();
+ NS_LOG(DEBUG, "rescanProvider - OUT");
+ return result;
+ }
+
+ NSConsumerService::ProviderDiscoveredCallback NSConsumerService::getProviderDiscoveredCb()
+ {
+ return m_providerDiscoveredCb;
+ }
+
+ std::shared_ptr<NSProvider> NSConsumerService::getProvider(const std::string &id)
+ {
+ return m_acceptedProviders->getProvider(id);
+ }
+
+ NSAcceptedProviders *NSConsumerService::getAcceptedProviders()
+ {
+ return m_acceptedProviders;
+ }
+ }
+}