replace : iotivity -> iotivity-sec
[platform/upstream/iotivity.git] / android / android_api / base / jni / JniOcCloudProvisioning.h
1 /*
2 * //******************************************************************
3 * //
4 * // Copyright 2016 Samsung Electronics All Rights Reserved.
5 * //
6 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 * //
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
11 * //
12 * //      http://www.apache.org/licenses/LICENSE-2.0
13 * //
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.
19 * //
20 * //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 */
22
23 #include "JniOcStack.h"
24 #include "OCCloudProvisioning.hpp"
25 #include "JniOcCloudResultListener.h"
26 #include "JniGetAclIdByDeviceListener.h"
27 #include <mutex>
28
29
30 using namespace OC;
31
32 #ifndef _Included_org_iotivity_base_OcCloudProvisioning
33 #define _Included_org_iotivity_base_OcCloudProvisioning
34 class JniOcCloudProvisioning
35 {
36     public:
37         JniOcCloudProvisioning(std::shared_ptr<OCCloudProvisioning> cloudObject);
38         ~JniOcCloudProvisioning();
39
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);
45
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);
53
54     private:
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;
60 };
61
62
63 /* DO NOT EDIT THIS FILE - it is machine generated */
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 /*
68  * Class:     org_iotivity_base_OcCloudProvisioning
69  * Method:    requestCertificate
70  * Signature: (Lorg/iotivity/base/OcCloudProvisioning/RequestCertificateListener;)V
71  */
72 JNIEXPORT void JNICALL Java_org_iotivity_base_OcCloudProvisioning_requestCertificate
73   (JNIEnv *, jobject, jobject);
74
75 /*
76  * Class:     org_iotivity_base_OcCloudProvisioning
77  * Method:    getAclIdByDevice
78  * Signature: (Ljava/lang/String;Lorg/iotivity/base/OcCloudProvisioning/GetAclIdByDeviceListener;)V
79  */
80 JNIEXPORT void JNICALL Java_org_iotivity_base_OcCloudProvisioning_getAclIdByDevice
81   (JNIEnv *, jobject, jstring, jobject);
82
83 /*
84  * Class:     org_iotivity_base_OcCloudProvisioning
85  * Method:    getIndividualAclInfo
86  * Signature: (Ljava/lang/String;Lorg/iotivity/base/OcCloudProvisioning/GetIndividualAclInfoListener;)V
87  */
88 JNIEXPORT void JNICALL Java_org_iotivity_base_OcCloudProvisioning_getIndividualAclInfo
89   (JNIEnv *, jobject, jstring, jobject);
90
91 /*
92  * Class:     org_iotivity_base_OcCloudProvisioning
93  * Method:    getCRL
94  * Signature: (Lorg/iotivity/base/OcCloudProvisioning/GetCRLListener;)V
95  */
96 JNIEXPORT void JNICALL Java_org_iotivity_base_OcCloudProvisioning_getCRL
97   (JNIEnv *, jobject, jobject);
98
99 /*
100  * Class:     org_iotivity_base_OcCloudProvisioning
101  * Method:    postCRL0
102  * Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/ArrayList;Lorg/iotivity/base/OcCloudProvisioning/PostCRLListener;)V
103  */
104 JNIEXPORT void JNICALL Java_org_iotivity_base_OcCloudProvisioning_postCRL0
105   (JNIEnv *, jobject, jstring, jstring, jstring, jobjectArray, jobject);
106
107 #ifdef __cplusplus
108 }
109 #endif
110 #endif