1 /******************************************************************
3 * Copyright 2015 Samsung Electronics All Rights Reserved.
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 ******************************************************************/
21 #ifndef SIMULATOR_RESOURCE_JNI_H_
22 #define SIMULATOR_RESOURCE_JNI_H_
25 #include "simulator_resource_server.h"
27 class JniSimulatorResource
30 JniSimulatorResource(SimulatorResourceServerSP &resource);
32 static jobject toJava(JNIEnv *env, jlong resource);
33 void setResourceInfo(JNIEnv *env, jobject jobj);
34 static SimulatorResourceServerSP getJniSimulatorResourceSP(JNIEnv *env, jobject thiz);
36 SimulatorResourceServerSP m_sharedResource;
43 JNIEXPORT jobject JNICALL
44 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_getModel
47 JNIEXPORT void JNICALL
48 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_addAttributeInteger
49 (JNIEnv *, jobject, jstring, jint);
51 JNIEXPORT void JNICALL
52 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_addAttributeDouble
53 (JNIEnv *, jobject, jstring, jdouble);
55 JNIEXPORT void JNICALL
56 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_addAttributeBoolean
57 (JNIEnv *, jobject, jstring, jboolean);
59 JNIEXPORT void JNICALL
60 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_addAttributeString
61 (JNIEnv *, jobject, jstring, jstring);
63 JNIEXPORT void JNICALL
64 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_updateAttributeInteger
65 (JNIEnv *, jobject, jstring, jint);
67 JNIEXPORT void JNICALL
68 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_updateAttributeDouble
69 (JNIEnv *, jobject, jstring, jdouble);
71 JNIEXPORT void JNICALL
72 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_updateAttributeBoolean
73 (JNIEnv *, jobject, jstring, jboolean);
75 JNIEXPORT void JNICALL
76 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_updateAttributeString
77 (JNIEnv *, jobject, jstring, jstring);
79 JNIEXPORT void JNICALL
80 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_updateAttributeFromAllowedValues
81 (JNIEnv *, jobject, jstring, jint);
83 JNIEXPORT void JNICALL
84 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_setRange
85 (JNIEnv *, jobject, jstring, jint, jint);
87 JNIEXPORT void JNICALL
88 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_setAllowedValuesInteger
89 (JNIEnv *, jobject, jstring, jobject);
91 JNIEXPORT void JNICALL
92 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_setAllowedValuesDouble
93 (JNIEnv *, jobject, jstring, jobject);
95 JNIEXPORT void JNICALL
96 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_setAllowedValuesString
97 (JNIEnv *, jobject, jstring, jobject);
99 JNIEXPORT jint JNICALL
100 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_startResourceAutomation
101 (JNIEnv *, jobject, jint, jint, jobject);
103 JNIEXPORT jint JNICALL
104 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_startAttributeAutomation
105 (JNIEnv *, jobject, jstring, jint, jint, jobject);
107 JNIEXPORT void JNICALL
108 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_stopAutomation
109 (JNIEnv *, jobject, jint);
111 JNIEXPORT void JNICALL
112 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_removeAttribute
113 (JNIEnv *, jobject, jstring);
115 JNIEXPORT void JNICALL
116 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_setObserverCallback
117 (JNIEnv *env, jobject object, jobject observer);
119 JNIEXPORT jobjectArray JNICALL
120 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_getObserversList
121 (JNIEnv *env, jobject object);
123 JNIEXPORT void JNICALL
124 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_notifyObserver
125 (JNIEnv *env, jobject object, jint jId);
127 JNIEXPORT void JNICALL
128 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_notifyAllObservers
129 (JNIEnv *env, jobject object);
131 JNIEXPORT void JNICALL
132 Java_org_oic_simulator_serviceprovider_SimulatorResourceServer_dispose
137 #endif //SIMULATOR_RESOURCE_JNI_H_