Imported Upstream version 0.9.2
[platform/upstream/iotivity.git] / service / resource-encapsulation / src / resourceContainer / bundle-api / include / ResourceContainerBundleAPI.h
1 //******************************************************************
2 //
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
4 //
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 //
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
10 //
11 //      http://www.apache.org/licenses/LICENSE-2.0
12 //
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.
18 //
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
20
21 #ifndef RESOURCECONTAINERBUNDLEAPI_H_
22 #define RESOURCECONTAINERBUNDLEAPI_H_
23
24 #include <unistd.h>
25 #include <string.h>
26 #include <fstream>
27
28 #include "RCSBundleInfo.h"
29 #include "Configuration.h"
30 #include "NotificationReceiver.h"
31 #include "BundleResource.h"
32
33 using namespace OIC::Service;
34
35 namespace OIC
36 {
37     namespace Service
38     {
39         class ResourceContainerBundleAPI: public NotificationReceiver
40         {
41             public:
42
43                 /**
44                 * Constructor for ResourceContainerBundleAPI
45                 */
46                 ResourceContainerBundleAPI();
47
48                 /**
49                 * Virtual destructor for ResourceContainerBundleAPI
50                 */
51                 virtual ~ResourceContainerBundleAPI();
52
53                 /**
54                 * Register bundle resource in the container
55                 *   and register resource server for bundle resource
56                 *
57                 * @param resource - bundle resource to register
58                 *
59                 * @return void
60                 */
61                 virtual void registerResource(BundleResource *resource) = 0;
62
63                 /**
64                 * Unregister bundle resource from the container
65                 *   and unregister resource server
66                 *
67                 * @param resource - bundle resource to unregister
68                 *
69                 * @return void
70                 */
71                 virtual void unregisterResource(BundleResource *resource) = 0;
72
73                 /**
74                 * Get Configuration data of certain bundle
75                 *
76                 * @param [in] bundleId - bundle id to get configuration data
77                 *
78                 * @param [out] configOutput - returned configuration data
79                 *
80                 * @return void
81                 */
82                 virtual void getBundleConfiguration(const std::string &bundleId, configInfo *configOutput) = 0;
83
84                 /**
85                 * Get the list of Configuration data of resources that certain bundle has
86                 *
87                 * @param [in] bundleId - bundle id to get configuration data
88                 *
89                 * @param [out] configOutput - returned resource configuration data vector
90                 *
91                 * @return void
92                 */
93                 virtual void getResourceConfiguration(const std::string &bundleId,
94                                                       std::vector< resourceInfo > *configOutput) = 0;
95
96                 /**
97                 * API for getting an instance of ResourceContainerBundleAPI
98                 *
99                 * @return ResourceContainerBundleAPI * - return the object pointer of ResourceContainerBundleAPI
100                 */
101                 static ResourceContainerBundleAPI *getInstance();
102         };
103     }
104 }
105
106 #endif