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 APIs provided to the developers.
27 #ifndef RCSRESOURCECONTAINER_H_
28 #define RCSRESOURCECONTAINER_H_
36 #include "RCSBundleInfo.h"
44 * @class RCSResourceContainer
45 * @brief This class provides APIs for managing the container and bundles in the container.
48 class RCSResourceContainer
52 * API for starting the Container
54 * @details This API start the container with the provided Configuration file.
56 * @param configFile configuration File that contains the Bundle/Bundles information.
59 virtual void startContainer(const std::string &configFile) = 0;
61 * API for stopping the Container
63 virtual void stopContainer() = 0;
67 * API for getting the list of all bundles in the container.
68 * The returned list and the contained bundle information are a copy
69 * and will not be updated by the resource container.
71 * @return List of BundleInfo pointer each associated with a bundle
74 virtual std::list<std::unique_ptr<RCSBundleInfo>> listBundles() = 0;
76 * API for starting the bundle.
78 * @param bundleId Id of the Bundle
81 virtual void startBundle(const std::string &bundleId) = 0;
83 * API for Stopping the bundle
85 * @param bundleId Id of the Bundle
88 virtual void stopBundle(const std::string &bundleId) = 0;
90 // dynamic configuration
92 * API for adding the bundle to the Container
94 * @param bundleId Id of the Bundle
95 * @param bundleUri Uri of the bundle
96 * @param bundlePath Path of the bundle
97 * @param activator Activation prefix for .so bundles, or activator class name for .jar bundles
98 * @param params key-value pairs in string form for other Bundle parameters
101 virtual void addBundle(const std::string &bundleId, const std::string &bundleUri,
102 const std::string &bundlePath, const std::string &activator,
103 std::map<std::string, std::string> params) = 0;
105 * API for removing the bundle from the container
107 * @param bundleId Id of the Bundle
110 virtual void removeBundle(const std::string &bundleId) = 0;
113 * API for adding the Resource configuration information to the bundle
115 * @param bundleId Id of the Bundle
116 * @param resourceUri URI of the resource
117 * @param params key-value pairs in string form for other Bundle parameters
120 virtual void addResourceConfig(const std::string &bundleId, const std::string &resourceUri,
121 std::map<std::string, std::string> params) = 0;
123 * API for removing the Resource configuration information from the bundle
125 * @param bundleId Id of the Bundle
126 * @param resourceUri URI of the resource
129 virtual void removeResourceConfig(const std::string &bundleId, const std::string &resourceUri) = 0;
132 * API for getting the list of Bundle Resources
134 * @param bundleId Id of the Bundle
137 virtual std::list<std::string> listBundleResources(const std::string &bundleId) = 0;
140 * API for getting the Instance of ResourceContainer class
142 * @return Instance of the "RCSResourceContainer" class
145 static RCSResourceContainer *getInstance();
148 RCSResourceContainer();
149 virtual ~RCSResourceContainer();
151 RCSResourceContainer(const RCSResourceContainer &) = delete;
152 RCSResourceContainer(RCSResourceContainer &&) = delete;
153 RCSResourceContainer &operator=(const RCSResourceContainer &) const = delete;
154 RCSResourceContainer &operator=(RCSResourceContainer &&) const = delete;
159 #endif /* RCSRESOURCECONTAINER_H_ */