2 * //******************************************************************
4 * // Copyright 2016 Samsung Electronics All Rights Reserved.
6 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
8 * // Licensed under the Apache License, Version 2.0 (the "License");
9 * // you may not use this file except in compliance with the License.
10 * // You may obtain a copy of the License at
12 * // http://www.apache.org/licenses/LICENSE-2.0
14 * // Unless required by applicable law or agreed to in writing, software
15 * // distributed under the License is distributed on an "AS IS" BASIS,
16 * // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * // See the License for the specific language governing permissions and
18 * // limitations under the License.
20 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
23 #include "JniOcStack.h"
24 #include "OCCloudProvisioning.h"
25 #include "JniOcCloudResultListener.h"
26 #include "JniGetAclIdByDeviceListener.h"
32 #ifndef _Included_org_iotivity_base_OcCloudProvisioning
33 #define _Included_org_iotivity_base_OcCloudProvisioning
34 class JniOcCloudProvisioning
37 JniOcCloudProvisioning(std::shared_ptr<OCCloudProvisioning> cloudObject);
38 ~JniOcCloudProvisioning();
40 static JniOcCloudProvisioning* getJniOcCloudProvisioningPtr(JNIEnv *env, jobject thiz);
41 JniOcCloudResultListener* AddCloudResultListener(JNIEnv* env, jobject jListener);
42 JniGetAclIdByDeviceListener* AddGetAclByDeviceListener(JNIEnv* env, jobject jListener);
43 void RemoveCloudResultListener(JNIEnv* env, jobject jListener);
44 void RemoveGetAclByDeviceIdListener(JNIEnv*, jobject);
46 OCStackResult requestCertificate(JNIEnv* env, jobject jListener);
47 OCStackResult getAclIdByDevice(JNIEnv*, std::string, jobject);
48 OCStackResult getIndividualAclInfo(JNIEnv*, jobject, std::string &);
49 OCStackResult getCRL(JNIEnv* env, jobject jListener);
50 OCStackResult postCRL(JNIEnv* env, const std::string& thisUpdate,
51 const std::string& nextUpdate, const OCByteString *crl,
52 const stringArray_t *serialNumbers, jobject jListener);
55 std::map<jobject, std::pair<JniOcCloudResultListener*, int>> resultMap;
56 std::map<jobject, std::pair<JniGetAclIdByDeviceListener*, int>> aclresultMap;
57 std::mutex resultMapLock;
58 std::mutex aclresultMapLock;
59 std::shared_ptr<OCCloudProvisioning>m_sharedCloudObject;
63 /* DO NOT EDIT THIS FILE - it is machine generated */
68 * Class: org_iotivity_base_OcCloudProvisioning
69 * Method: requestCertificate
70 * Signature: (Lorg/iotivity/base/OcCloudProvisioning/RequestCertificateListener;)V
72 JNIEXPORT void JNICALL Java_org_iotivity_base_OcCloudProvisioning_requestCertificate
73 (JNIEnv *, jobject, jobject);
76 * Class: org_iotivity_base_OcCloudProvisioning
77 * Method: getAclIdByDevice
78 * Signature: (Ljava/lang/String;Lorg/iotivity/base/OcCloudProvisioning/GetAclIdByDeviceListener;)V
80 JNIEXPORT void JNICALL Java_org_iotivity_base_OcCloudProvisioning_getAclIdByDevice
81 (JNIEnv *, jobject, jstring, jobject);
84 * Class: org_iotivity_base_OcCloudProvisioning
85 * Method: getIndividualAclInfo
86 * Signature: (Ljava/lang/String;Lorg/iotivity/base/OcCloudProvisioning/GetIndividualAclInfoListener;)V
88 JNIEXPORT void JNICALL Java_org_iotivity_base_OcCloudProvisioning_getIndividualAclInfo
89 (JNIEnv *, jobject, jstring, jobject);
92 * Class: org_iotivity_base_OcCloudProvisioning
94 * Signature: (Lorg/iotivity/base/OcCloudProvisioning/GetCRLListener;)V
96 JNIEXPORT void JNICALL Java_org_iotivity_base_OcCloudProvisioning_getCRL
97 (JNIEnv *, jobject, jobject);
100 * Class: org_iotivity_base_OcCloudProvisioning
102 * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Lorg/iotivity/base/OcCloudProvisioning/PostCRLListener;)V
104 JNIEXPORT void JNICALL Java_org_iotivity_base_OcCloudProvisioning_postCRL0
105 (JNIEnv *, jobject, jstring, jstring, jstring, jobjectArray, jobject);