8467da3bed602baef236c69aee51b012f6f1b1e3
[platform/upstream/iotivity.git] / service / resource-manipulation / src / resourceContainer / include / BundleInfoInternal.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 BUNDLEINFOINTERNAL_H_
22 #define BUNDLEINFOINTERNAL_H_
23
24 #include <string>
25 #include "BundleInfo.h"
26 #include "ResourceContainerBundleAPI.h"
27 #include "jni.h"
28
29 using namespace std;
30 using namespace OIC::Service;
31
32 namespace OIC{
33     namespace Service{
34
35         typedef void activator_t(ResourceContainerBundleAPI *, std::string bundleId);
36         typedef void deactivator_t(void);
37
38         class BundleInfoInternal: public BundleInfo
39         {
40             public:
41                 BundleInfoInternal();
42                 BundleInfoInternal(BundleInfo *info);
43                 virtual ~BundleInfoInternal();
44                 void setID(string id);
45                 string getID();
46                 void setPath(string path);
47                 string getPath();
48                 void setVersion(string version);
49                 string getVersion();
50
51                 void setLoaded(bool loaded);
52                 bool isLoaded();
53                 void setActivated(bool activated);
54                 bool isActivated();
55
56                 virtual void setLibraryPath(string libpath);
57                 virtual string getLibraryPath();
58
59                 void setActivatorName(string activatorName);
60                 string getActivatorName();
61
62                 void setJavaBundleActivatorMethod(jmethodID activator);
63                 jmethodID getJavaBundleActivatorMethod();
64                 void setJavaBundleDeactivatorMethod(jmethodID deactivator);
65                 jmethodID getJavaBundleDeactivatorMethod();
66
67                 void setJavaBundleActivatorObject(jobject);
68                 jobject getJavaBundleActivatorObject();
69
70                 void setBundleActivator(activator_t *);
71                 activator_t *getBundleActivator();
72
73                 void setBundleDeactivator(deactivator_t *);
74                 deactivator_t *getBundleDeactivator();
75
76                 void setBundleHandle(void *);
77                 void *getBundleHandle();
78
79                 void setJavaBundle(bool javaBundle);
80                 bool getJavaBundle();
81
82                 void setBundleInfo(BundleInfo* bundleInfo);
83
84             private:
85                 bool m_loaded, m_activated, m_java_bundle;
86                 int m_id;
87                 activator_t *m_activator;
88                 deactivator_t *m_deactivator;
89                 void *m_bundleHandle;
90                 string m_activator_name;
91                 jmethodID m_java_activator, m_java_deactivator;
92                 jobject m_java_activator_object;
93                 string m_library_path;
94         };
95     }
96 }
97
98 #endif /* BUNDLEINFOINTERNAL_H_ */