correct the comment about mis-definition of class "RCSResourceContainer" for doxygen
[platform/upstream/iotivity.git] / service / resource-encapsulation / include / RCSResourceContainer.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 /**
22  * @file
23  *
24  * This file contains the resource container APIs provided to the developers.
25  */
26
27 #ifndef RCSRESOURCECONTAINER_H_
28 #define RCSRESOURCECONTAINER_H_
29
30 #include <string>
31 #include <vector>
32 #include <map>
33 #include <list>
34
35 #include "RCSBundleInfo.h"
36
37 namespace OIC
38 {
39     namespace Service
40     {
41
42         /**
43          * @class   RCSResourceContainer
44          * @brief   This class provides APIs for managing the container and bundles in the container.
45          *
46          */
47         class RCSResourceContainer
48         {
49             public:
50                 /**
51                  * API for starting the Container
52                  *
53                  * @details This API start the container with the provided Configuration file.
54                  *
55                  * @param configFile configuration File that contains the Bundle/Bundles information.
56                  *
57                  */
58                 virtual void startContainer(const std::string &configFile) = 0;
59                 /**
60                 * API for stopping the Container
61                 */
62                 virtual void stopContainer() = 0;
63
64                 // list of bundle ids
65                 /**
66                 * API for getting the list of all bundles in the container
67                 *
68                 * @return List of BundleInfo pointer each associated with a bundle
69                 *
70                 */
71                 virtual std::list<RCSBundleInfo *> listBundles() = 0;
72                 /**
73                  * API for starting the bundle.
74                  *
75                  * @param bundleId Id of the Bundle
76                  *
77                  */
78                 virtual void startBundle(const std::string &bundleId) = 0;
79                 /**
80                 * API for Stopping the bundle
81                 *
82                 * @param bundleId Id of the Bundle
83                 *
84                 */
85                 virtual void stopBundle(const std::string &bundleId) = 0;
86
87                 // dynamic configuration
88                 /**
89                  * API for adding the bundle to the Container
90                  *
91                  * @param bundleId Id of the Bundle
92                  * @param bundleUri Uri of the bundle
93                  * @param bundlePath Path of the bundle
94                  * @param activator Activation prefix for .so bundles, or activator class name for .jar bundles
95                  * @param params  key-value pairs in string form for other Bundle parameters
96                  *
97                  */
98                 virtual void addBundle(const std::string &bundleId, const std::string &bundleUri,
99                                        const std::string &bundlePath, const std::string &activator,
100                                        std::map<std::string, std::string> params) = 0;
101                 /**
102                  * API for removing the bundle from the container
103                  *
104                  * @param bundleId Id of the Bundle
105                  *
106                  */
107                 virtual void removeBundle(const std::string &bundleId) = 0;
108
109                 /**
110                 * API for adding the Resource configuration information to the bundle
111                 *
112                 * @param bundleId Id of the Bundle
113                 * @param resourceUri URI of the resource
114                 * @param params key-value pairs in string form for other Bundle parameters
115                 *
116                 */
117                 virtual void addResourceConfig(const std::string &bundleId, const std::string &esourceUri,
118                                                std::map<std::string, std::string> params) = 0;
119                 /**
120                 * API for removing the Resource configuration information from the bundle
121                 *
122                 * @param bundleId Id of the Bundle
123                 * @param resourceUri URI of the resource
124                 *
125                 */
126                 virtual void removeResourceConfig(const std::string &bundleId, const std::string &resourceUri) = 0;
127
128                 /**
129                 * API for getting the list of Bundle Resources
130                 *
131                 * @param bundleId Id of the Bundle
132                 *
133                 */
134                 virtual std::list<std::string> listBundleResources(const std::string &bundleId) = 0;
135
136                 /**
137                  * API for getting the Instance of ResourceContainer class
138                  *
139                  * @return Instance of the "RCSResourceContainer" class
140                  *
141                  */
142                 static RCSResourceContainer *getInstance();
143
144             protected:
145                 RCSResourceContainer();
146                 virtual ~RCSResourceContainer();
147
148                 RCSResourceContainer(const RCSResourceContainer &) = delete;
149                 RCSResourceContainer(RCSResourceContainer &&) = delete;
150                 RCSResourceContainer &operator=(const RCSResourceContainer &) const = delete;
151                 RCSResourceContainer &operator=(RCSResourceContainer &&) const = delete;
152         };
153     }
154 }
155
156 #endif /* RCSRESOURCECONTAINER_H_ */