ddc79ca8f736025245e291a0298620e1b974c966
[platform/upstream/iotivity.git] / service / resource-encapsulation / src / resourceContainer / bundle-api / include / BundleActivator.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 BUNDLEACTIVATOR_H_
22 #define BUNDLEACTIVATOR_H_
23
24 #include "ResourceContainerBundleAPI.h"
25
26 using namespace OIC::Service;
27
28 namespace OIC
29 {
30     namespace Service
31     {
32
33         /**
34         * @class    BundleActivator
35         * @brief    This class represents Bundle to be activated by container
36         *
37         */
38         class BundleActivator
39         {
40
41             public:
42
43                 /**
44                 * Constructor for BundleActivator
45                 */
46                 BundleActivator();
47
48                 /**
49                 * Virtual destructor for BundleActivator
50                 */
51                 virtual ~BundleActivator();
52
53                 /**
54                 * Activate the Bundle to make bundle work and create bundle resources
55                 *
56                 * @param resourceContainer ResourceContainer which registers the bundle
57                 *
58                 * @param bundleId Assigned id for the bundle
59                 *
60                 * @return void
61                 */
62                 virtual void activateBundle(ResourceContainerBundleAPI *resourceContainer,
63                                             std::string bundleId);
64
65                 /**
66                 * Deactivate the Bundle to stop working and destroy bundle resources
67                 *
68                 * @return void
69                 */
70                 virtual void deactivateBundle();
71
72                 /**
73                 * Create Bundle Resource instance and register the resource in the container
74                 *
75                 * @param resourceInfo Information of the bundle resource to be created
76                 *
77                 * @return void
78                 */
79                 virtual void createResource(resourceInfo resourceInfo) = 0;
80
81                 /**
82                 * Destroy Bundle Resource instance and register the resource in the container
83                 *
84                 * @param pBundleResource Bundle resource to be destroyed
85                 *
86                 * @return void
87                 */
88                 virtual void destroyResource(BundleResource::Ptr pBundleResource) = 0;
89         };
90     }
91 }
92
93 #endif /* RESOURCEBUNDLE_H_ */