1 //******************************************************************
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
24 * This file contains the resource container Bundle APIs provided
25 * to the resource bundle developers.
28 #ifndef RESOURCECONTAINERBUNDLEAPI_H_
29 #define RESOURCECONTAINERBUNDLEAPI_H_
31 #include "Configuration.h"
32 #include "NotificationReceiver.h"
33 #include "BundleResource.h"
35 using namespace OIC::Service;
43 * @class ResourceContainerBundleAPI
44 * @brief This class provides APIs for retrieving bundle and resource configuration
45 * and registering/unregistering resources.
48 class ResourceContainerBundleAPI: public NotificationReceiver
52 * Register bundle resource in the container
53 * and register resource server for bundle resource
55 * @param resource bundle resource to register
59 virtual void registerResource(BundleResource::Ptr resource) = 0;
62 * Unregister bundle resource from the container
63 * and unregister resource server
65 * @param resource Bundle resource to unregister
69 virtual void unregisterResource(BundleResource::Ptr resource) = 0;
72 * Get Configuration data of certain bundle
74 * @param [in] bundleId Bundle id to get configuration data
76 * @param [out] configOutput Returned configuration data of bundle
80 virtual void getBundleConfiguration(const std::string &bundleId, configInfo *configOutput) = 0;
83 * Get the list of Configuration data of resources that certain bundle has
85 * @param [in] bundleId Bundle id to get configuration data
87 * @param [out] configOutput Returned vector of resource configuration data
91 virtual void getResourceConfiguration(const std::string &bundleId,
92 std::vector< resourceInfo > *configOutput) = 0;
95 * API for getting an instance of ResourceContainerBundleAPI
97 * @return ResourceContainerBundleAPI * Return the object pointer of ResourceContainerBundleAPI
99 static ResourceContainerBundleAPI *getInstance();
102 ResourceContainerBundleAPI();
103 virtual ~ResourceContainerBundleAPI();
105 ResourceContainerBundleAPI(const ResourceContainerBundleAPI &) = delete;
106 ResourceContainerBundleAPI(ResourceContainerBundleAPI &&) = delete;
107 ResourceContainerBundleAPI &operator=(const ResourceContainerBundleAPI &) const = delete;
108 ResourceContainerBundleAPI &operator=(ResourceContainerBundleAPI &&) const = delete;