Imported Upstream version 1.0.1
[platform/upstream/iotivity.git] / service / simulator / java / jni / simulator_resource_server_jni.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 SIMULATOR_RESOURCE_JNI_H_
22 #define SIMULATOR_RESOURCE_JNI_H_
23
24 #include <jni.h>
25 #include "simulator_resource_server.h"
26
27 class JniSimulatorResource
28 {
29     public:
30         JniSimulatorResource(SimulatorResourceServerSP &resource);
31
32         static jobject toJava(JNIEnv *env, jlong resource);
33         void setResourceInfo(JNIEnv *env, jobject jobj);
34         static SimulatorResourceServerSP getJniSimulatorResourceSP(JNIEnv *env, jobject thiz);
35     private:
36         SimulatorResourceServerSP m_sharedResource;
37 };
38
39
40 #ifdef __cplusplus
41 extern "C" {
42
43 JNIEXPORT jobject JNICALL
44 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_getModel
45 (JNIEnv *, jobject);
46
47 JNIEXPORT void JNICALL
48 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_addAttributeInteger
49 (JNIEnv *, jobject, jstring, jint);
50
51 JNIEXPORT void JNICALL
52 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_addAttributeDouble
53 (JNIEnv *, jobject, jstring, jdouble);
54
55 JNIEXPORT void JNICALL
56 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_addAttributeBoolean
57 (JNIEnv *, jobject, jstring, jboolean);
58
59 JNIEXPORT void JNICALL
60 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_addAttributeString
61 (JNIEnv *, jobject, jstring, jstring);
62
63 JNIEXPORT void JNICALL
64 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_updateAttributeInteger
65 (JNIEnv *, jobject, jstring, jint);
66
67 JNIEXPORT void JNICALL
68 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_updateAttributeDouble
69 (JNIEnv *, jobject, jstring, jdouble);
70
71 JNIEXPORT void JNICALL
72 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_updateAttributeBoolean
73 (JNIEnv *, jobject, jstring, jboolean);
74
75 JNIEXPORT void JNICALL
76 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_updateAttributeString
77 (JNIEnv *, jobject, jstring, jstring);
78
79 JNIEXPORT void JNICALL
80 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_updateAttributeFromAllowedValues
81 (JNIEnv *, jobject, jstring, jint);
82
83 JNIEXPORT void JNICALL
84 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_setRange
85 (JNIEnv *, jobject, jstring, jint, jint);
86
87 JNIEXPORT void JNICALL
88 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_setAllowedValuesInteger
89 (JNIEnv *, jobject, jstring, jobject);
90
91 JNIEXPORT void JNICALL
92 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_setAllowedValuesDouble
93 (JNIEnv *, jobject, jstring, jobject);
94
95 JNIEXPORT void JNICALL
96 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_setAllowedValuesString
97 (JNIEnv *, jobject, jstring, jobject);
98
99 JNIEXPORT jint JNICALL
100 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_startResourceAutomation
101 (JNIEnv *, jobject, jint, jint, jobject);
102
103 JNIEXPORT jint JNICALL
104 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_startAttributeAutomation
105 (JNIEnv *, jobject, jstring, jint, jint, jobject);
106
107 JNIEXPORT void JNICALL
108 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_stopAutomation
109 (JNIEnv *, jobject, jint);
110
111 JNIEXPORT void JNICALL
112 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_removeAttribute
113 (JNIEnv *, jobject, jstring);
114
115 JNIEXPORT void JNICALL
116 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_setObserverCallback
117 (JNIEnv *env, jobject object, jobject observer);
118
119 JNIEXPORT jobjectArray JNICALL
120 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_getObserversList
121 (JNIEnv *env, jobject object);
122
123 JNIEXPORT void JNICALL
124 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_notifyObserver
125 (JNIEnv *env, jobject object, jint jId);
126
127 JNIEXPORT void JNICALL
128 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_notifyAllObservers
129 (JNIEnv *env, jobject object);
130
131 JNIEXPORT void JNICALL
132 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_dispose
133 (JNIEnv *, jobject);
134
135 }
136 #endif
137 #endif //SIMULATOR_RESOURCE_JNI_H_